texts:
I'm trying to figure out where exactly to draw the confidence levels for the autocorrleation function (ACF) and the partial autocorrelation function (PACF) for an ARMA model.

For PACF I found that a number of sources (including Wikipedia) define the confidence levels at 95% by using $$\pm 1.96/\sqrt{n}$$.

Question 1: How do they get 1.96 when the confidence is 95%?

However, most sources I find online, state that the 95% confidence level is at $$\pm 2/\sqrt{n}$$.

Question 2: Why do they use 2 instead of 1.96? Is this a simple round-up thing or is there something mathematical behind it?

Now for the ACF, how exactly do I specify the levels? On Wikipedia, it states:

  Correlograms are also used in the model identification stage for
  fitting ARIMA models. In this case, a moving average model is assumed
  for the data and the following confidence bands should be generated:
  $$\pm z_{1-\alpha/2}\sqrt{\frac{1}{N}\left(1+2\sum_{i=1}^{k}
> y_i^2\right)}$$

Question 3: How exactly to you calculate this? What are $y_i$, $z$ and $\alpha$ variables?

Question 4: The description above states that this is for the MA model. What about the AR and ARMA models, do they calculate the confidence differently?


texts: Why can't the callee whom I am on call with hear the sound coming from my phone's speaker but I can while my phone is on loud speaker?

texts:
I was on call with my friend and have put the phone on loud speaker and I opened youtube,The sound was audible to me but not to my friend.
How is it even possible when he can hear my voice but not the sound coming from the speakers


texts: How many way to reduce overfitting problem of Linear classificationH

texts: I am working in linear classification such as y=ax+b. where x={x1...xn}. But the method has weakness that is overfitting problem. Could you suggest to me one method or one way to reduce overfitting problem in linear classification (don't consisder other method ex SVM). Thank you so much


texts:
I'm attempting to perform multi-resolution analysis via Continuous-Wavelet Transform (CWT) using Pywavelets. I've heard that CWT is supposed to be superior to STFT due to varying frequency content as a function of the time-window.

My test signal is two sinusoids of 1Hz and 5Hz, each lasting 10 seconds (see picture): f=np.sin(2.*np.pi*t)*((t>=10)&(t<=20))+np.sin(2*np.pi*5*t)*((t>=30)&(t<=40)). The sampling period is 20Hz.

Using Pywavelets, I perform the CWT as follows with the resulting spectrogram:

scales = np.arange(0.6,65,step=0.2)
coef, freqs=pywt.cwt(f,scales,'cgau1', sampling_period=dT)

As you can see the frequency resolution is quite lousy, and the peak (complex magnitude) doesn't even seem to line up at 5Hz for the second segment.

In contrast, a STFT using the Gaussian window with a standard deviation of 5 results in much sharper frequency resolution (at the expense of time sharpness):

Am I doing something here? I'm willing to sacrifice time resolution but I do need to sharpen up the frequency.


texts:
I am a bit confused with the concept of band limited wavetables and the methods such as BLET, BLIP, MinBLEP, polyBLEP etc.

As far as I understand certain waveforms contain infinite harmonics, which alias back into the signal, even if they were generated at a certain frequency below the Nyquist rate. According to this paper Alias-Free Digital Synthesis of Classic Analog Waveforms, these basic waveforms have aliasing "due to having to round off the discontinuity time to the nearest available sampling instant".

What and were is the discontinuity of the waveform if the wavetable contains e.g. a full cycle of a sawtooth wave at a certain frequency? (where looping the table will restart the new cycle from the last point of the old one)

After reading through some code on how MinBLEPs work, Im confused with how all these steps are linked. E.g. the signal is windowed and FFT'd and I assume the cepstrum function is used to look for the discontinuity inside the FFT bins. I dont get what the minimum phase is used for. The signal is then run through the iFFT.

I please need help in understanding how all these techniques are combined and what exactly is done in the practical sense.

After all of this, is the minBLEP a kind of wavelet that is stored in a buffer and then applied to the signal being generated, so that it smooths the discontinuities? At first I thought this was all done inside an oscillator which needs some level of look ahead to constantly detect discontinuities and apply the minBLEP wavelet at the correct time, but now I don't get how this is done inside the wavetable generator function itself (offline), that an oscillator can just scan in real time.


texts: Does it make sense to express a given FT from 0 to 1 as a convolution?

texts:
I'm learning about Fourier transform, and was asked whether the following FT can be expressed as a convolution: $$X[k] = \sum\limits_{n=0}^{N=1} x[n]e^{-i\frac{2\pi}{N}kn}$$
There are two things I don't understand:

Why would anyone want to express the FT itself as a convolution? from what I understand, FT is used to express convolution, as stated by the Convolution Theorem.
Assuming it does make sense to express an FT as a convolution, how can we do that with the above FT?


texts:
I am trying to filter EEG signals using butterworth filter and filtfilt. I have gone through a lot of documentation and these 2 commands seem sufficient for filtering. However, the results are bizarre.

from scipy.signal import butter, filtfilt
import sys, pickle
from numpy import *
import matplotlib.pyplot as plt

def butter_bandpass(lowcut, highcut, fs, order=5):
    nyq = 0.5 * fs
    low = lowcut / nyq
    high = highcut / nyq
    b, a = butter(order, [low, high], btype='band')
    return b, a

def butter_bandpass_filter(data, lowcut, highcut, fs, order=5):
    b, a = butter_bandpass(lowcut, highcut, fs, order=order)
    y = filtfilt(b, a, data)
    return y

with open(sys.argv[1]) as eeg:
    eeg_data = pickle.load(eeg)
    eeg_data = eeg_data[:,3]

fs = 128
lowcut = 1
highcut = 40.0

y = butter_bandpass_filter(eeg_data, lowcut, highcut, fs, order = 9)
plt.plot(y,'r')
plt.show()

This is the eeg data

Also, isn't the output in time domain? It seems incorrect irrespective of the domain. The order is too high i.e. 1e28 for the first 1000 points. I checked for the other points and the order is 1e17, even for points after 4000. Is this what I should expect?


texts: How can I use the fourier transform of a sequence of x-ray scan images to segment it?

texts:
Sorry if this question seems to trivial, but I am a bit of a novice when it comes to signal and image processing and I need some guidance.

I have a 3D stack of about 256 grey scale images, each with pixel resolution 256x256, coming from an x-ray tomography scan of a rock sample.  I want to segment the data to isolate the void space from the solid space.  Typically I use ImageJ software to segment it using its 'auto' feature based upon a histogram of the grey-scale color values.  I am wondering if using fourier transform of the grey-scale data can somehow help me in the process.  What can the FT tell me about the image data that I can use for segmentation purposes?


texts: inverse FFT when only a few time points are needed

texts:
I am developing C++ code to do some modeling that will take as input a parametric model of the complex frequency response (amplitude, phase) and produce as output an impulse response, e.g. using the iFFT. I would like to compare this to a "windowed" impulse response that I have measured for a loudspeaker in a room. The measured impulse can be characterized by an initial portion that corresponds to sound traveling directly through the air to the microphone that lasts a few millisecond, after which sounds that reflect off of the surfaces in the room (floor, walls, etc.) contaminates the signal. The uncontaminated portion is only 3% of the total measured impulse. For instance if I record 16k points at 96kHz, its only the first 470 points of the impulse. I want to compare the impulse response that the iFFT generates from the frequency response model to ONLY the uncontaminated portion of the measured impulse.

I could calculate the entire impulse response from the frequency response and then just throw away 97% of the result but this seems to be very inefficient. The iFFT will be calculated many, many times (thousands probably) while my model is being optimized so I want to make sure that I can make it as efficient as possible. At this point my only option seems to be using FFTW and then just throwing away the data that is not needed (for lack of a better idea).

Is there a fast way to calculate the inverse FFT only for those 470 time points of interest, e.g. not for the entire time span that the FFT can access? I am not intimately familiar with the computation of the FFT and iFFT, so I don't have insight on the answer to this question.


texts:
I have a question: Do DCT each output coefficients have to be orthogonal?
Here DCT is DCT-II type. It is used by the jpeg compression algorithm.


texts: Converting musicg spectrogram output to dBFS

texts:
I'm trying to convert musicg Spectrogram output to dBFS.

With 16-bit signed integer PCM audio, and an FFT length of 2048, I'm trying to analyze the spectrogram for an audio file to determine things like "Was a particular frequency notched out by equalization" or "Was the audio high-passed or low-passed" by looking for peaks in the spectrogram.

I'm taking a normalized musicg spectrogram, and converting the magnitude values to dBFS (max value: 0 dBFS) by doing:

dBFS = (20 * Math.log10( 2 * Math.abs(magnitude) / 2048)) - 100

I think this is giving me what I'm looking for, and it correlates closely to what I'm seeing in other tools.  And if I decrease the gain on a file by 20db, and then analyze the decreased file, the dBFS data I get back is 20db less than the original.

However, I noticed that when I view the spectrogram in Audacity (using plot spectrum), the dB values in Audacity seem to range between 4db and 9db higher than what I'm getting from musicg and the above equation.

Is there something I'm doing particularly wrong in the way I'm trying to calculate dBFS from the musicg absolute spectrogram data?  (or perhaps I'm mistaken and what I'm calculating, and what Audacity is displaying, are not quite the same thing)


texts: How does sampling rate affect discrete filters?

texts:
I am just starting to learn discrete filters and I could use some help. I understand continuous signals and filters.

I am trying to understand the math behind discrete filtering. For example in the s domain, a simple low pass filter can be recognized as $$\dfrac{1}{\tau s+1}$$
 How does sampling rate affect a discrete low pass filter?


texts: gnuradio: Best way to sync to simple preamble

texts:
I never figured out a clean way to sync to a simple preamble in GNU Radio 3.7/3.8, so I built my own block to do so. It was a variation on the Correlate Access Code - Tag Stream block that simply cut out the code relating to the header length fields and supplied a property for the user to hardcode the payload length in the flowgraph. This is an extremely useful thing to do when reverse engineering RF systems. You can find the blocks here, along with a few other custom blocks:
https://github.com/paulgclark/gr-reveng
With GNU Radio 3.9 out, I was about to start the process of porting these blocks over to the new OOT scheme, but I wanted to make sure I wasn't duplicating features already in the tool somewhere. I haven't found them anywhere, but I know there's a bunch of great new stuff in there like the new Symbol Sync block, so I thought I'd ask. I have not found a way to get the Protocol Parser to implement this without customization, but I may be missing something.
Any other ideas, or should I just start porting my block?
Thanks
PC


texts: Can you predict how long a discontinuity will take to reach its target if it is low pass filtered at a certain frequency?

texts:
Let's say you have a signal that relatively slowly rises from 0 to 1, then suddenly from one sample to the next drops back to 0, creating a sharp discontinuity. Let's say you run it through a one pole low pass filter at a given frequency, say 200 Hz to smooth it.

Is there any way to predict or graph or calculate how long it will take after the discontinuity for the signal to reach 0 or near 0?


texts: Finding the component vectors for a grid of points

texts:
I have a 2d 'grid' of xy points (2000 of them).
I want to find the average vector between points
I have drawn the vectors on the graph, how do I find these vectors mathematically? I want to find the average vector between points for the whole set of points.


texts:
How can I determine the poles and zeros of a system given its frequency Response?

I can understand how one can find the Frequency response from poles and zeros of a system. Is it possible to do it the other way round?


texts: Prove the dirac delta contains all frequencies

texts:
I'm looking for a mathematical proof that the dirac delta contains all frequencies.

I just read in a text book that the frequency spectrum of a dirac is just a horizontal line of amplitude 1, whereas some things I've read online show the Fourier transform should look more like a complex exponential.

Either way, would someone be able to clear up for me the way in which the dirac has a broad band frequency spectrum such as white noise?


texts: Deriving SER & BER for 4QAM, 16QAM and 32QAM

texts:
Required to find symbol error rate vs $E_b/N_0$ for 4QAM, 16QAM & 32QAM.  Thought that SER & BER are the same but did my research to find that BER is $1/\log_2(M)$ of SER. Could you please confirm this?
Also found SER for:

4QAM to be: $\displaystyle \text{erfc}\sqrt{\dfrac{E_b}{2N_0}}$

and that of 16QAM to be: $\displaystyle\dfrac{3}{2} \text{erfc}\sqrt{\dfrac{E_b}{10N_0}}$

Are these values correct?  Still have problems to find SER for 32QAM...
Hope you can help.


texts:
I have series of images extracted from a eye tracker video for both eyes.
is there any image processing algorithm/method/technique available to find the following from those images:

Horizontal eye movement for both eyes.
Vertical eye movement for both eyes.
Eye blinking for both eyes.

Thanks in advance for the help.


texts:
I have a 2-D discrete signal in which each point can be represented as $(x, y)$. These points are varying with time $t$. Can we represent the TV-norm using the following formula?

$$\sum_{t}|x_t - x_{t-1}| + |y_t - y_{t-1}|$$


texts:
I'm honestly lost on creating timing diagrams for bit sequences. I understand for QPSK there are symbols 00, 01, 10, 11 with phase shifts of 45,135,225 and 315.

I'm just not understanding how you get these diagrams.
I graphed an example on paper but it doesn't seem consistent (using the bit sequence below).

Maybe I'm a bit lost on the whole even and odd bit sequences.

For example, I'm looking at a bit stream of 01100101 0 (also I assume that lone bit at the end can be written as 00)

So b(t) = 011001010

be(t)=X0100

bo(t)=X1011

E denoting Even, O denoting Odd

Thanks

Edit: Also again, for example, I grabbed this from Wikipedia

https://en.wikipedia.org/wiki/Phase-shift_keying#Bit_error_rate_2

I feel I'm just missing something that will make it all click. Thanks!


texts: How can I learn image processing in a practical way?

texts:
I am a beginner in image processing and I have to learn to program in MATLAB as soon as possible. I started with Rafael Gonzalez book, but understanding this theoretical knowledge and mathematical aspect from one side and bringing this knowledge into practice for doing my project from the other sides, it is a challenging task for me.I am working on 3D medical images. So I should learn how to do pattern recognition with these images.

Do you have any tips on how to translate my theoretical knowledge into practical knowledge?
Which programming language is suitable and convenient for learning image processing/computer vision and doing practical projects?


texts: Calculation of cross-correlation of a system with noise

texts:
Having the following system:

I'd like to know how to obtain the cross-correlation between$\ w(n) $ and$\ y(n) $ having the following conditions: $\ w(n) $ is a zero-mean white noise with power$\ P_w $ that is uncorrelated with$\ x(n) $, and $\ x(n) $ and $\ z(n) $ are Wide Sense Stationary random processes with $\ H(w) = |H(w)|exp[j \theta(w)] $


texts: Cepstrum: IFFT or FFT to enter the cepstral domain?

texts:
I'm trying to implement source-filter separation of some pre-recorded speech in Max/MSP. I'm unsure of whether one uses an FFT to enter the cepstral domain, or an IFFT. Some of the textbooks and dissertations I've found that cover this topic say that I should perform an FFT to get into the cepstral domain and then an IFFT to exit back into the frequency domain; others say that I should perform an IFFT to enter the cepstral domain and then an FFT to get back into the frequency domain! The first way makes more sense to me, but something about my patch isn't quite working quite right, and I'm not sure what I'm doing wrong.

Here is how I understand the procedure (Please tell me if you notice anything incorrect):

1. Perform an FFT on the time-domain signal to enter the frequency domain.
2. Do Mel scaling (optional) and then logify.
3. Do an FFT (or an IFFT, depending on who you ask) to enter the cepstral domain.
4. Separate the low bins (the filter) from the high bins (the source / excitation signal).
5. Perform an IFFT (or an FFT, depending on who you ask) on both source and filter to exit back into the frequency domain.
6. Exponentiate both source and filter.
7. Modify amplitude of filter bins.
8. Multiply the modified filter with the source signal.
9. Un-Mel-scale (optional).
10.Perform an IFFT to exit back into the time domain.

In Step 3, should I use an FFT or an IFFT? (And then Step 5 will be the opposite of whatever Step 3 is.)

P.S.: I am not trying to modify phase information, only change some amplitude information of the filter portion of the signal (the lower FFT bins in the cepstral domain) before I add/multiply them back together.


texts:
I am trying to simulate a QPSK transmission using GNU Radio following mpsk_stage6.grc example in Gnuradio tutorials.

Currently I have no idea where is the problem and everytime I execute the flow graph i get this on a.txt file.

I am not sure why this flow graph is not correct.
Thank you in advance.


texts: why adding noise enhances the accuracy sometimes?

texts:
I am applying simple FFT to estimate the frequencies of the oscillations. The real values of frequencies are known to me as I made a synthesis signal for simulation.Thus, I can calculate the error simply. The signal contains 4 different frequencies. FFT can estimate these components fairly accurate.
 when, the noise is added to the signal it is expected to see an increase in estimation errors. also increasing the noise strength must increase the error size naturally.
 The question is this, in most case the error is increased in with noise. But for some cases,'one or two modes out of four', the error is decreased and better accuracy is obtained in noisy environment. why this is happening.
please provide some rational reasons with some references to this unexpected phenomenon.
Thanks in the best way
P.S The added noise is zero mean Guassian


texts: Auto-covariance of the product of deterministic and wide-sense stationary signal

texts:
Anybody give me an advice how to find the auto-covariance of the product of deterministic and wide-sense stationary signal. I couldn't find how to solve this, I have looked and searched the internet, I found just 1 similar topic here so I think someone in here may solve it.

The mean and autocorrelation of $X(t)$ are $m$ and $R$, respectively, and the $X(t)$ process is wide-sense stationary. $g(t)$ is a deterministic function, $Y(t)=X(t)\cdot g(t)$ is defined.

A. Find the mean, autocovariance and autocorrelation functions of the $Y(t)$ process.
B. Is the $Y(t)$ process wide-sense stationary ? Explain your answer.


texts: How to choose the right segment length for a given signal?

texts:
Im working on plotting the power spectral density of a random time series measured. I know the target spectrum.The idea is check the measurement vis-a-vis the target spectrum. However, I get slightly different plots for segment lengths of 128 & 256, its noisy for higher segment lengths. For 128 its a closer match. For 256 its smooth, but there is a slight bulge in the spectrum at the top (when compared to the target).

Im not sure which one to go with to validate the measuring device.
Please advise.

Edit : 1. Hand sketch of the look of the plot added for 256 point segment length.
       2. For 128 point, its more or less an exact match.


texts: Expressing DTFTs in terms of one another with similar time domain signals

texts:
I cam across a question in my DSP book asking this:
1). Express $X_2(e^{j\omega})$ in terms of $X_1(e^j\omega)$ without explicitly computing $X_1(e^{j\omega})$. ($X_1(e^j\omega)$ represents the DTFT of $x_1[n]$)
\begin{align}
x_1[n] &= \left[1 \ 2 \ 2 \ 1\right]\\
x_2[n] &= \begin{cases}
x_1[n] & 0 \leq n \leq 3\\
x_1[n-4] & 4 \leq n \leq 7\\
0   & \text{otherwise}\end{cases}
\end{align}
Here is my code and answer, but Im dont think my answer is correct. What should I be looking for in the time domain graphs that can give clues to the DTFT? ( i know my dtft function needs some work but I will do that next)
Thanks
%% P3.2
% 1). The magnitude plot of X2(jw) should have a similar shape to X1(jw) because
%     they contain the similar frequency components, but part of X2 is just phase
%     shifted, therefore the angle plots might be a bit different.
% 2).

n1 = 0:3;
x1 = [1 2 2 1];
stem(n1,x1); axis([0 7 -4 4]);

n2 = 0:7;
x2 = [1 2 2 1 1 2 2 1];
%    ( x1[n])(x1[n-4])
figure;
stem(n2,x2); axis([0 7 -4 4]);

k = 0:200;

X1 = dtft(n1,x1,k);

X2 = dtft(n2,x2,k);

function X = dtft(n,x,k)
% DESCRIPTION
%  Performs an approximate Discrete Time Fourier Transform
%  the approximation is due to the fact that the output is
%  not continous. ex. X = dtft(n,x,k);
%
% NOTE : Only for finite duration signals.
%
% INPUT VARIABLES
%  n = number of samples
%  x = array containing time domain signal samples
%  k = evenly spaced divisions of omega (frequency)
%
% OUTPUT VARIABLES
%  X = the transformed output
%  Various graphs of signal aspects
%
% REFERENCES
%  Adapted from "Digital Signal Processing Using MATLAB 3rd ed." - Ingle, V.,
%  Proakis, J. (pg. 65).
%
% DOCUMENTATION
%  ver 1.0 by Dominic Meads  5/8/2020
%  filename: dtft.m
%
% ENGINEER'S COMMENTS
%  The authors reccommend to use this more as an
%  excersize rather than a full function. As stated above, use the DFT for
%  better results.
%

w = (pi/100)*k;  % calculates the evenly spaced frequencies
X = x * (exp(-j*pi/100)) .^(n'*k); % calculates the DTFT

magX = abs(X);  % for graphs
angX = angle(X);
realX = real(X);  % divide into real and imaginary parts
imagX = imag(X);

figure('Color', [1 1 1]);
subplot(2,2,1); plot(w/pi,magX); grid off;
xlabel('frequency in units of pi'); title('Magnitude part');
subplot(2,2,2); plot(w/pi,realX); grid off;
xlabel('frequency in units of pi'); title('Real part');
subplot(2,2,3); plot(w/pi,angX); grid off;
xlabel('frequency in units of pi'); title('Angle part');
subplot(2,2,4); plot(w/pi,imagX); grid off;
xlabel('frequency in units of pi'); title('Imaginary part');
end


texts: Difference between single sided and double sided amplitude spectrum

texts:
I've recently gotten stuck with a small issue. I was asked to plot the single sided amplitude spectrum of the signal $x(t)=\cos(2\pi\cdot20000t)$.

I know that $X(f) = \frac{1}{2}\cdot\left[\delta(f-20000) + \delta(f+20000) \right]$. So there should be 2 impulses with amplitudes of $\frac{1}{2}$ at $\pm 20\,\text{kHz}$.

But I tried using Keysight's Advanced Design System to plot the single sided amplitude spectrum, and only got one impulse at $20\,\text{kHz}$ with an amplitude of $1$.

Why is this so?


texts: Confusion about collection of bits and symbols

texts:
I'm taking an intro communications module and I'm quite confused on what the term "symbol" really means?

Consider this setup:

My understanding is as folllows

After the information source, we have  a stream of bits coming in 0 1 0 1 0 0 0 1 1.....
The source encoder takes these bits and groups them into sets of N bits.
The channel encoder takes these sets of N bits and based on what coding scheme we use (gray coding) for example, it will multiply it by a certain coefficient of a orthogonal basis function (carrier signal) depending on what exact gray code it is.
The digital modulator now receives a coefficient of it's carrier/basis function and just mulitplies it by the fixed carrier/basis function (either sin or cos of something) and sends it onto the channel.

My question is - what point in this transmitter do we call "the symbol"? Is it the group of N bits after the source encoder? Or is it the coefficient of the orhtogonal basis function after the channel encoder?


texts:
For one stereo camera, stereo calibration is performed to obtain intrinsic and extrinsic parameters during manufacturing.
During the process of usage, intrinsic and extrinsic parameters may be changed, and left image and right image are not aligned any more if rectification is applied.
I have some point correspondences between left image and right image.The y coordinates of the correpondences is not same.
If I rectify the left and right images, I can find the disparity may be negative which means that the points are behind the camera.
I can also triangulate the point correpondences using intrinsic and extrinsic parameters to obtain 3d point coordinates, and the z coordinates of 3d points may be negative.
Is there any way to know whether the disparity is negative without stereo rectification?
Is there any way to know the case the calcuated points is behind the camera without trigulation?
I know the corresponding point doesn't lie on the epipolar line for such cases, however such information can't tell me whether the
3d point of point correspondence is behind the camera. I try to calculate the sign of the distance from the point to
the epipolar line but it seems the sign can't tell me such information.


texts: What is the difference between the PSD of a deterministic and stochastic signal?

texts:
I am learning about stochastic processes and I don't get one thing:

What is the advantage of calculating the PSD of a signal using the Wiener-Khinchin theorem $\Phi(\omega) =\mathcal{F}\{R_{xx}\}$ and calculating its PSD with $\Phi(\omega) =X(\omega) X^*(\omega)$.

I mean, if I record some random signal and I want to get its spectrum then I do $\mathcal{F}\{x(t)\}$.

What's wrong about using this way?
Why should I deal with autocorrelation and Wiener-Khinchin-Theorem?

I've created in MATLAB a cosine with random amplitude, so in my understanding this is a stochastic signal

t = 0:0.1:1000
x = rand() * cos(t)
plot(abs(fft(xcorr(x,x))))
plot(abs(fft(x)).^2)

Both plots seem to be very equal, I can't see the difference.


texts: Jack buffer size and FFT frequency resolution

texts:
In my actual Jack Audio setup (almost default values), Fs = 48kHz the buffer size is 1024 samples.

I'm planning to do some filtering (lowpass, highpas, ...) and choose to use FFT.

Had done some reading and found that the frequency resolution is $ Fs \over n $ so in that case the frequency resolution will be

$$
{Fs \over n} = {48000 \over 1024} = 46,875
$$

Which is a high value and well imprecise value do deal with it.

What if want do 60Hz highpass filtering ? (c[0][1] = 46Hz, c[0][2] = 92Hz c is complex returned from fft function.)

Some details:

I have choose FFT because i think more simple to do such simple things, but i'm a really beginner in the DSP field this can be false.

Ps: In jack you register a callback and it gets called when there's data to be processed, with a buffer and it's buffer size (fixed).


texts: Assuming a pulse shaping of a source of symbols (like $s=\{3,-i,2+5i\}$), and a SRRC waveform (or any other waveform). I know that it depends on many factors like modulation scheme, but, in practice, are there any typical value or range of "number of samples per symbol" required for the pulse shaping process?


texts: Discrete Fourier Transform a dummy approach

texts:
I'm trying to understand how DFT works exactly. However, when experimenting around, I compared both Matlab generated FFT result with a dummy approach result and I get similar result.

However, the Imaginary part of both results are negated. The code below is my implementation. The implementation of dummy approach is based on http://en.wikipedia.org/wiki/Discrete_Fourier_transform#Definition

$$
X_k = \sum_{n=0}^{N-1}x_n . e^{-i2\pi kn/N}\,.
$$

Fs = 500; % Sampling frequency
T = 1/Fs; % Sample time
N = 1000; % Length of signal
t = (0:N-1)*T; % Time vector
x = cos(2*pi*100*t)+randn(size(t));

% Calculate by using Matlab build-in FFT
fdft = fft(x);

% A dummy way to calculate DFT
n = 0:N-1;
k = 0:N-1;
kn = bsxfun(@times, n', k);
dummydft = x * exp(-i * 2 * pi * kn / N )';

Is there anything I miss? Thank you.


texts: I understand the need for phase unwrapping and the complexity behind it. But, I'm struggling to understand why the phase information gets wrapped between $-\pi$ to $\pi$ in the first place?


texts:
I have some basic maths skill up to derivatives.
I ask you if you know any simple/concise book that can introduce me to DSP world. Thank you.


texts: Help me understanding this source code of a Phaser

texts:
I tried to understand the following source code of a Phaser:

#define SR (44100.f)  //sample rate
#define F_PI (3.14159f)

 class Phaser{
 public:
     Phaser()  //initialise to some usefull defaults...
      : _fb( .7f )
      , _lfoPhase( 0.f )
      , _depth( 1.f )
      , _zm1( 0.f )
  {
    Range( 440.f, 1600.f );
    Rate( .5f );
  }

  void Range( float fMin, float fMax ){ // Hz
      _dmin = fMin / (SR/2.f);
      _dmax = fMax / (SR/2.f);
  }

  void Rate( float rate ){ // cps
      _lfoInc = 2.f * F_PI * (rate / SR);
  }

  void Feedback( float fb ){ // 0 -> <1.
      _fb = fb;
  }

  void Depth( float depth ){  // 0 -> 1.
      _depth = depth;
  }

  float Update( float inSamp ){
      //calculate and update phaser sweep lfo...
      float d  = _dmin + (_dmax-_dmin) * ((sin( _lfoPhase ) +  1.f)/2.f);
      _lfoPhase += _lfoInc;
      if( _lfoPhase >= F_PI * 2.f )
          _lfoPhase -= F_PI * 2.f;

      //update filter coeffs
      for( int i=0; i<6; i++ )
          _alps[i].Delay( d );

      //calculate output
      float y =     _alps[0].Update(
                   _alps[1].Update(
                    _alps[2].Update(
                     _alps[3].Update(
                      _alps[4].Update(
                       _alps[5].Update( inSamp + _zm1 * _fb ))))));
      _zm1 = y;

      return inSamp + y * _depth;
  }
 private:
     class AllpassDelay{
     public:
      AllpassDelay()
          : _a1( 0.f )
          , _zm1( 0.f )
          {}

      void Delay( float delay ){ //sample delay time
          _a1 = (1.f - delay) / (1.f + delay);
      }

      float Update( float inSamp ){
          float y = inSamp * -_a1 + _zm1;
          _zm1 = y * _a1 + inSamp;

          return y;
      }
  private:
      float _a1, _zm1;
  };

  AllpassDelay _alps[6];

  float _dmin, _dmax; //range
  float _fb; //feedback
  float _lfoPhase;
  float _lfoInc;
  float _depth;

  float _zm1;

};

I understood most of it but i can´t find out what the purpose of the _zm1 variables is. There are two of them one in the AllpassDelay class, which are never used and one in the Phaser class which modifies the feedback.
Can someone explain me what this does?
Thanks


texts: modulate/demodulate audio file as FSK signal mixed with music signal

texts:
What I want to do:
I want to encode an audio message inside a regular music file; this shall be decoded by an audio analyzer running on another machine (by listening to the audio playback from the first machine).

What I have tried so far:
Encode:

Change the pitch of secret audio message to D#/EB-10 (which is 19.5
KHz according to this site:
http://www.flutopedia.com/pitch_to_frequency.htm). This should
convert the secret audio message to something that falls outside of
the human audible range.
Merge this secret audio message with music file.

Decode:

Apply high pass filter at 19 KHz.
Change pitch back to the original range (e.g. B-6)

I'm using Audacity to do the above steps.

The problems that I'm facing:
1. The "secret" message is still audible in the encoded output.
2. Decoded output is significantly different than the secret message.

I'm new to the audio dsp domain, so I'd appreciate a review of my approach and suggestions to achieve the goal that I described above.

Edit:
Below is the spectrum plot for "secret" audio message generated using Audacity.

Edit2:
Below image shows linear spectral chart for "secret" signal mixed with generated tone of 19kHz.

Edit3:
The below spectral graph is for the carrier "music" file.


texts:
Why phase information is usually ignored after Fourier transform?

I have read in a tutorial [ref: FFT Tutorial] that interpretation of phase is usually challenging, so scientists do not show it or use it for their analysis. I would like to know when one can confidently ignore phase information without losing key information in his/her judgements.


texts: Could you please help me understanding how the null sub-carriers can be used to estimate the carrier frequency offset and thus performing frequency Synchronization at the receiver?


texts: Advice needed for separating 3-channel signals

texts:
I'm working on a personal project, where I'm trying to make a touch screen that uses force sensors as the basis of the technology. The rig I've made has have three transducers underneath a square platform, with the goal of identifying touch events on the platform (with both the force and location) via triangulation.

I've got the simple "single event" case working fine, but I'm having trouble when there are two overlapping touch events. This would be the basis of a multi-touch function.

Below is a reference graph to help me explain what I'm trying to achieve:

We have three input signals (A, B & C) shown in green, with their summed signal in black. These signals contain two touch events, which overlap.

What I need to do is generate two "clean" 3-channel signals, each with only touch event inside.

The ideal output signals are shown with:
- the first "touch" event signals (A-1, B-1 & C-1) coloured in blue
- the second "touch" event signals (A-2, B-2 & C-2) coloured in red

I'm pretty sure this is possible, as I can at least identify when there are two overlapping signals; by using the algorithm below:

identifying the activity period between settles
scan over the activity period
measure the ratio between each signals gradient and the gradient of the sum each signal
If the ratio is off by more than a set threshold then there's more than one event

Does anyone have an idea on how to accomplish this or something similar?

Any advice or steers would be appreciated (especially in layman terms) as I'm self taught in this area.

Thanks a lot!


texts: Is it possible to transmit and/or receive multiple types of signals at the same time?

texts:
Using an inexpensive SDR (such as the USRP or Per Vices Phi), I want to process two or more communication protocols at the same time (e.g. WiFi and GSM). Is it possible to Tx (or Rx) both at the same time, like FDMA, or would they need to do some fast switching between modulations and frequencies, like TDMA? I'm not sure if the receiver would be able to accept it though since it is not expecting TDMA.

So I think FDMA would be the best approach, but like I said the question is whether or not it's possible to construct a waveform that can transmit both protocols simultaneously. I think it may also depend on frequency separation, combined bandwidths, mutual sample rate, etc.


texts: Normalizing a spectrogram or a pitch class profile

texts:
I am developing a chord recognition program using neural networks.I need to normalize the spectrogram or my pitch class profile to provide inputs for the neural network. The pitch class profile classifies the frequency into 12 class semitones (From note A to G).

The problem here is it produces really high values and low values: they can be on the order of ten, one million, or even a trillion. Meanwhile, the input values for the neural network should be between 1 and -1.

What is a normalization formula that I can use to transform the values to be between 1 and -1?


texts:
In Harris Corner detection, is there any particular reason why this function is chosen:

$R=det(M)-k*trace(M)^2$

We want to a function to evaluate how fast E(u,v) fluctuate accross different direction, but can't we use other function such as:

$R=1-(\lambda_1+\lambda_2)^2$


texts:
The Wiener-Hopf is given by

$$\mathbf W_\text{opt} = \mathbf R^{-1} \mathbf P$$

What if the matrix $\mathbf R$ is almost singular?
When $\mathbf R$ is singular, the inverse of $\mathbf R$ does not exist,
what modification can I do to make it usable?

My idea is move the $\mathbf R$ to the left side of the equation, is that right?


texts: Why is the Z-transform so important in digital filters analysis and design?

texts: Please elaborate on why this mathematical transform can help analyzing as well as designing any type of digital filter.


texts:
So I have the following data:

[[-344    13771   4600 ]
 [-275.2  12478   6410 ]
 [-206.4  19443    830 ]
 [-137.6  69392   3830 ]
 [ -68.8  143737  3780 ]
 [   0    189278 16870 ]
 [  68.8  184486  5090 ]
 [ 137.6  188466  9380 ]
 [ 206.4  185023 21680 ]
 [ 275.2  128133  1460 ]
 [ 344    51288   1950 ]
 [ 412.8  10854   4290 ]]

First column is the x value (position in microns).  Second value is the recorded data point (y), and the third column is the error (noise).

I am wondering how I can find the response of my device if the data I record is known to be a convolution of the response and a slit of width 83.6666 (plus noise).

My attempt was to use the convolution theorem of fourier transforms and use MatLab's fft() to solve for the desired function, but I could not figure out how to get everything the same length.  I also thought about being blunt and using deconv() but that gave me something very strange, (with my rect function defined as

>> x=-344:1:412;
>> h=zeros(size(x));
>> h(300:386)=1;

So I used deconv(h,y) and got a very strange looking plot that was not a function.

So I was hoping someone could give me some advice on how to perform this mathematically (code or no code).  Especially with the addition of noise.

Thanks!


texts: Cascaded one-pole sections and relationship to time constant

texts:
I have implemented a typical one-pole lowpass filter to smooth out some control signals.
The form of the filter is:
$$
y1 = x0 + b1\centerdot(y1 - x0)
$$
x0 is the current input sample.
y1 is the past output sample.
b1 is a smoothing coefficient.

Now I specify the b1 coefficient in terms of how much time it will take for the filter to converge to a certain percentage of the final value.
For example, the following equation makes sure that it will take 300 ms for the signal level to converge to 1% (0.01) of the final value. SR is the sampling rate of the system.
$$
\large {b1 = e^{\frac{ln(0.01)}{300 * SR * 0.001}}}
$$
…or in a more computationally expensive form:
$$
\large {b1 = 10^{\frac{log_{10}(0.01)}{300 * SR * 0.001}}}
$$

Let's see an example:
$$
\large {b1 = e^{\frac{ln(0.01)}{5}}}
$$

This causes the one pole filter to converge to 1% of the final value in 5 samples.
Let's initialize y1 with 1 and y0 with 0.
Now let's see the first 5 samples of the impulse response of the filter:
$$
[1]\quad y1 = y0 + b1\centerdot(y1 - y0)\rightarrow y1 = 0.3981072\\
[2]\quad y1 = y0 + b1\centerdot(y1 - y0)\rightarrow y1 = 0.1584893\\
[3]\quad y1 = y0 + b1\centerdot(y1 - y0)\rightarrow y1 = 0.0630957\\
[4]\quad y1 = y0 + b1\centerdot(y1 - y0)\rightarrow y1 = 0.0251189\\
[5]\quad y1 = y0 + b1\centerdot(y1 - y0)\rightarrow y1 = 0.0100000\\
$$
This is what we wanted, the signal is now 0.01 compared to the
original 1.
The impulse response of the filter will be exactly x after n samples.

So far, so good…

Now I would like to make the transition even smoother so I started cascading more one-pole sections.
$$
y1_a = x0_a + b1\centerdot(y1_a - x0_a)\\
y1_b = y1_a + b1\centerdot(y1_b - y1_a)\\
y1_c = y1_b + b1\centerdot(y1_c - y1_b)\\
…
$$
This certainly works well and gives the wanted effect, however it also messes up my time constant.
For the same b1 coefficient the more cascaded one-pole sections the longer the filter takes to converge.
So I would like to know what value the b1 coefficient has to take in order to make the filter converge in the same amount of time for more cascaded sections.

More specifically I would like to find an equation that takes:
- time in ms
- sample rate
- number of cascaded one-pole sections

and gives:
- value of the b1 coefficient.

Is anybody so kind to take my hand and lead me through the math?
Thank you so much.

Luigi


texts:
I have a confusion regarding the matched filter detection technique. I have a binary information source signal $s(t)$ that is corrupted by additive White Gaussian noise $w(t)$ at a particular SNR. The received signal is:
$$x(t) = s(t) + w(t)$$
Then I have created a matched filter $h(t)$ as the time reversal of the source binary signal $s(t)$. How does a matched filter work?


texts: Minimum number of data points needed for a DFT to avoid spectrum leakage?

texts:
Let $x(t) = 0.4 + 0.5 \cos (2 \pi f_1 t) + 2 \cos (2\pi f_2 t) + \sin(2 \pi f_2 t) + 1.5 \cos(2\pi f_3 t)$ where $f_1 = 3 kHz, f_2 = 5 kHz, f_3 = 8 kHz$. If $x[n]$ is obtained by sampling $x(t)$ with a sampling frequency of $f_s = 16 kHz$ what is the minimum number of data points needed for a DFT in order to resolve all the frequencies without spectrum leakage?

Can someone point me in the right direction on this?

UPDATE work:

With $f_s = 16000, T_s = \frac{1}{16000}$, we have:

\begin{align*}
  x(t) &= 0.4 + 0.5 \cos (2 \pi f_1 t) + 2 \cos (2\pi f_2 t) + \sin(2 \pi f_2 t) + 1.5 \cos(2\pi f_3 t) \\
  x[n] &= 0.4 + 0.5 \cos (2 \pi \frac{3}{16} n) + 2 \cos (2\pi \frac{5}{16} n) + \sin(2 \pi \frac{5}{16} n) + 1.5 \cos(2\pi \frac{1}{2} n) \\
\end{align*}

The discrete periods would be $\frac{16}{3}, \frac{16}{5}, 2$, right?


texts: Downsampling and upsampling of a signal in Python

texts:
If I want to downsample a signal in Python, is it better to use method resample from SciPy Signal Processing module or method decimate from the same module? What is the difference between these two approaches?
And my next question is: Which is the best way of upsampling a signal?

Thank you very much for replies.


texts: How to convert a low-pass Gaussian filter to a high pass filter

texts:
I have the following code for a applying a Gaussian filter to an image. From what I understand this is a low pass filter. Now I have to convert this into a high-pass filter, and from what we were told from the instructions, one difference between  Gaussian low and high pass filters is that for a high-pass, the sum of the elements in the filter kernel should sum up to zero as opposed to one like for the-low pass filter. How should I go about doing this?

%%horizontal and vertical coordinates
coordinates = -floor(N/2) : floor(N/2);
[X Y] = meshgrid(coordinates, coordinates);
N = 12;
sigma=2;

gfilter = exp(-(X.^2 + Y.^2)/(2*sigma.^2));
gfilter = gfilter/sum(gfilter(:));

I = mean(double(imread('image.png')),3);
GaussBlur = conv2(I,gfilter);
%%plot images side by side
subplot(1,2,1);
imshow(I, []);
subplot(1,2,2);
imshow(GaussBlur, []);


texts: Can wavelets be used for complex texture discrimination?

texts:
I've recently been studying wavelet analysis with a view to differentiating certain areas of texture images where the texture differs from the background pattern (which is quite random); for example a small ink smudge on a photo of sand or similar.

I've seen a lot of applications of Gabor wavelets used to pick out textural differences in things like fabrics, and other regular type patterns but I've not been able to find any applications of things like Daubechie/Harr wavelets for anything other than image compression.

Can different wavelet families be used to pick out textural differences such as my example or am I wasting my time?


texts: Is phase and amplitude information necessarily lost when undersampling?

texts:
Is phase and amplitude information necessarily lost when undersampling if you have a constant periodic single frequency sinusoidal?

My second question is: How can one determine the undersampling frequency for such a case? And how to retrieve the amplitude and phase.

I want to know if this is possible for a sampling frequency much lower than the Nyquist rate.


texts:
I am looking for information on how to decode slow scan TV signals, which is a method of transmitting static images using everyday FM radio.

I have seen software but I don't understand how to start. Any open source would help as well. To very specific I want to know how to decode the sound into an image.


texts: Pattern matching methods: Based on Area and Based on features

texts:
Good morning, I'm new to image processing and I'm currently working on a project for pattern matching and OCR more specifically.

In the state of art I've found the matching process can be classified into 2: Area based matching and feature based matching. The ABM approaches involve techniques like Cross Correlation which is basically and sliding window, meanwhile the FBM is based on features extraction in order to do the matching of the pattern based on a feature vector...

And here comes my doubt: The extraction of the characteristics can be generally done by algorithms like SIFT and SURF and RANSAC for the selection of the best matching points, but I came across the HOG descriptor which basically would be of good use for pattern matching without having to use any classifier at all, and it would be very simple to implement for the recognition of the characters by just comparing feature vectors.

So my question is, could this HOG descriptor be accurately classified as a method for FBM? OR where in the Computer Vision/Image Processing Area could this be classified?
And what would be the best and correct approach to using HOG in the OCR?

Thank you so much in advance!


texts: Get frequency and amplitude from an audio sample

texts:
I'm wondering how can i get the frequency and the amplitude from a 16 bits sample.
I have actually an array of 16 bits signed int and I would like to get the frequency and the amplitude of each sample. I've heard from FTT and stuff but I'm kinda new to signal processing about audio.
Any advice would be appreciated,

Thanks.


texts: A few conceptual questions about filter, pole, and bilinear

texts:
I am working on a school project on converting a 6th order butterworth high pass filter to digital filter using bilinear transformation.

Just got a couple conceptual questions need to be clarified before I continue.

In an analog 6th order butterworth filter, the poles are the same for highpass and lowpass since poles are found in the denominator?
I have found 6 poles, and say my first pole is -0.259+ 0.966i if my cut off frequency is $1 \textrm{ rad/s}$. If my cut off frequency is changed to $10000 \textrm{ rad/sec}$. The radius of the unit circle would be $10000$ and my pole would be -2590 + 9660i?
Is there anyway someone could verify that once applied bilinear transformation without pre-wraping the frequency (professor said do it without pre-wraping first and compare to wrapped after), in the $z$-plane the poles would be:

0.1894 + 0.7499i
0.1894 - 0.7499i
0.1405 + 0.4077i
0.1405 - 0.4077i
0.1222 + 0.1283i
0.1222 - 0.1283i

I'm quite new on DSP, any help is appreciated.


texts: Why is the frequency response different based on the amplitude of the impulse I feed into the filter?

texts:
I am working on a 2-pole IIR high-pass filter.  The filter is fixed point and it is causing me some issues.  I believe I'm just misunderstanding something.  I am implementing everything in Octave for now, but eventually it will be implemented in a 32-bit processor.  The corner frequency is very low, $2.7\textrm{ Hz}$.

When I test the filter by passing in an impulse and then doing an fft on the output, I get different results based on the magnitude of the impulse.

First, I made the filter using signed 64-bit integers just for testing.  So the impulse I feed into the filter looks like this:

Fs = 51200; %sample frequency
impulse = int64( [2^31, zeros(1,Fs*10-1)] ); %multiply by 10 to get 0.1 Hz resolution

Here is the fixed-point impulse response compared against the floating-point impulse response.

If I rerun the code but with a larger impulse I get the desired frequency response.

Fs = 51200; %sample frequency
impulse = int64( [2^63, zeros(1,Fs*10-1)] ); %multiply by 10 to get 0.1 Hz resolution

They match so closely you can barely see the red, floating-point response.

Why is there this difference just from changing the amplitude of the input?
I need to implement this in 32 bits, but when I do, the amplitude of the input is restricted to $2^{31}$ so I end up with the distorted impulse response.  How can I fix this or work around this?


texts:
I have a video and I want to calculate the SNR for it.

I know how to do it with an audio signal, but with a video I don't have a clue. I'm using SCILAB for the analysis.


texts: How to determine initial values in Kalman Filter

texts:
I have EEG signal and exract PSD feature from it, then must apply it a noise reduction algorithm, I used Kalman filter,

but the output signal in the paper is much smoother than my output and
vertical axis is different in my case

I think that is because of Kalman filter initialization; initial state and predict.

Here is my output and paper output.

Papers output:

Mine :

Here is MATLAB code:

N = length(z);          % number of Klamn filter iterations
Qfactor = 1;            % process noise mult factor
Rfactor = 1;          % measurement noise mult factor
F = [ 1   2            % update matrix
      0   1 ];
H = [ 1   0 ];            % measurement matrix
sigmaQ = 5e-5;
sigmaR = 1;
Q = sigmaQ^2 * [ 8/3  2     % process noise covariance matrix
                  2   2 ];
R = sigmaR^2 * [ 1 ];         % measurement noise covariance
P = zeros(2, 2, N);
x = zeros(2, N);
x(:,1) = [ 0
           0 ];
P(:,:,1) = Q;

for i=2:N
    [xpred, Ppred] = predict(x(:,i-1), P(:,:,i-1), F, Q);
    [nu, S] = innovation(xpred, Ppred, z(i), H, R);
    [x(:,i), P(:,:,i)] = innovation_update(xpred, Ppred, nu, S, H);
end

plot(x(1,2:N),'b');

The functions:

Prediction

function [xpred, Ppred] = predict(x, P, F, Q)
 xpred = F * x;
 Ppred = F * P * F' + Q;
Inovation :

function [nu, S] = innovation(xpred, Ppred, z, H, R)
 nu = z - H * xpred;                   %% innnvoation
 S = R + H * Ppred * H';                 %% innovation covariance
and Inovation update :

function [xnew, Pnew] = innovation_update(xpred, Ppred, nu, S, H)
 K = Ppred * H' * inv(S);                 %% Kalman gain
 xnew = xpred + K * nu;                  %% new state
 Pnew = Ppred - K * S * K';              %% new covariance


texts: How does the $\mathcal Z$-transform's "region of convergence" work?

texts:
I'm a novice in DSP and I have few doubts regarding the $\mathcal Z$-transform and its region of convergence (ROC).

I know what a $\mathcal Z$-transform is. But I'm having trouble with understanding the ROC. First of all I have some confusion with $X(z)$ and $x(z)$. I easily get caught by exchanging these terms. I know the ROC defines the region of where the $\mathcal Z$-transform exists. From the web and my books states that:

  If $x[n]$ is a finite-duration sequence, then the ROC is the entire $z$-plane, except possibly $z = 0$ or $\lvert z\rvert = \infty$. A finite-duration sequence is a sequence that is nonzero in a finite interval $n_1 \le n \le n_2$

And later it says:

  When $n_2 > 0 $ there will be a $z^{-1}$ term and thus the ROC will not include $z=0$. When $n_1 < 0$ then the sum will be infinite and thus the ROC will not include $\lvert z\rvert=\infty$.

This is where I get stuck!. What they try to say in the above line "When $n_2 > 0$ there will be a $z^{-1}$ term and thus the ROC will not include $z=0$" What do they mean by $z=0$? Are they substituting $z$ as $0$, if so in which equation?

How do we calculate the region of convergence for an infinite sequence?


texts: Does FFT magnitude of recorded sound depends on the bit depth used?

texts:
Based on some reading, here's my understanding of how sound recording works:

Microphone outputs a voltage based on sound pressure. The microphone voltage is amplified and the amplified voltage goes into an ADC. The amplifier gain is such that the maximum microphone output is matched to the maximum input voltage of the ADC. The ADC converts the input voltage into a number, and this number's magnitude can depend on the number of bits. So let's say the max input voltage is 5V, this would be 255 for 8 bit, or 65535 for 16 bit.

When I record an audio stream using something like PyAudio on Python, the audio is composed of list of numbers that the ADC outputs, and that can vary based on if I used 8 bit or 16 bit encoding. Therefore, the FFT magnitude will vary too.

Please correct me if I'm wrong.


texts: How to compare binary signals with different lengths

texts:
I have bunch of 1d arrays of 0 and 1 with specific length as data. also i have a key signal(another 0,1 array) with shorter length than my data arrays.
Now how can i have a good measure of similarity or dissimilarity between those long arrays with the shorter key array?


texts:
In the Short-time Fourier transform what are the tradeoffs between different:

window functions
window lengths
sample rates


texts: Automatically crop out certain region around red objects

texts:
I have the image seen below and I would like be able to automatically crop out everything around each red section - not enough to overlap but enough that you can see how connected to the green parts they are. Is there an easy way to do this, ideally in python/R? In case it matters, I'll be doing some image recognition on the resulting images.

The top image is an example of what I'd like them to look like, the bottom is what I start with.

Sorry if this is stupidly easy or really general, I've never done any work with images so don't even know where to start.


texts:
According to Wikipedia,

  The sine wave or sinusoid is a mathematical function that describes a
  smooth repetitive oscillation.

The formula for the Sine wave is,

A = Amplitude of the Wave
ω = the angular frequency, specifies how many oscillations occur in a unit time interval, in radians per second
φ, the phase,
t = ?

Here ω, is the angular frequency i.e ,

It defines how many cycles of the oscillations are there.

Now let see the frequency,

  Frequency is the number of occurrences of a repeating event per unit
  time

For example, if 100 events occur within 15 seconds the frequency is:

Events = 100;
Time = 15;
FREQ = Events/Time;

Which means there is total 100 cycles of wave in 15 seconds , am i correct ?

Events = 71;
Time = 15;
FREQ = Events/Time;
W = 2*PI*FREQ;   % 2*PI for circular path
A = 2 ;

Now what is the use of small 't' ? in the Sine wave equation , what time is it ?


texts:
So I recently implemented a CMA equalizer in MATLAB that uses method of steepest descent to converge to the minimal cost. (Im on an equalizer implementation binge).

My questions are the following:

1) It seems to me that the CMA algorithm is only good for channels where they are relatively 'flat'. In other words, it is not expected to work for channels with deep fades/nulls? Is this generally true?

2) I am using a BPSK signal, and we can see from the first figure here, that after the multipath effects I have a smearing on the complex plane of my BPSK signal - there arent two nice clusters as one would expect. Instead, we see 4 red clusters. My question is how come after the CMA equalizer I still have 4 clusters? (I colored those blue). I suppose it makes some sense because the CMA simply forces the envelopes to be 1, and doesnt 'care' which cluster you are talking about. I have heard that CMA can suffer from local minima problems however. Would this be an example of it? (ie, getting 4 clusters instead of 2 since this is BPSK). If not, what can be done about it?

3) Almost as if answering question 2, I went ahead and changed the constant modulus that I seek to minimize the error against. Instead of choosing 1 (as is supposed to be the case for BPSK), I chose 0.25 to be the modulus. This is the constellation I got:

The problem is that even if this is a 'solution', how does one know apriori what to chose the modulus to be? The reason I consider it a problem is that if I have 4 clusters instead of 2 it makes post-symbol phase/frequency offset estimation/correction more complicated especially when one expects 2 clusters due to BPSK signalling.

(For completeness I have attached the same plots but when I added frequency offsets)

Thanks in advance for any insights you can give into this equalizer!


texts:
If I use a hydrophone with the sensitivity given as: "-200 dB re 1V/μPa".

Question: How should I interpret this? Is it the voltage given at -200 dB SPL or??

All the Best!


texts: How to generate colored Gaussian noise and adding it to a ODE system - Do I need Euler-Maruyama method?

texts:
In the tutorial, when white noise process is added to ordinary differential equations (ODE), the ODE becomes a stochastic process. Then the stochastic process needs to be solved using Euler Maruyama method and not ODE.

I am having a hard time understanding how to generate and add colored noise in the form of process noise to a continous system such as the Rossler system. randn() is used to generate White Noise in Matlab and I directly added it to the equations. But I don't know if this is the correct way to add noise to a continous time system or not. This is what I did to add White Noise to the equations:

noise_x = randn(1);
noise_y = randn(1);
noise_z = randn(1);
y = [
     -x(2)-x(3) + noise_x;            % dx/dt
     x(1)+a*x(2) + noise_y;           % dy/dt
     b+x(3)*(x(1)-c) + noise_z;       % dz/dt
] ;

color noise process using Euler-Maruyama Method (EM) seems to be the way to solve the stochastic system after the noise is added. But I cannot understand what is the color of the noise from this method. Looking at the code, there is no way to know if there is any color. After the color noise is generated by calling the function function [W,t]= colornoise(a,b,T,N) how to use the output W as an additive term in the Rossler system. This is not clear to me. Can somebody please provide a small code snippet on how to add White noise and color noise such as pink, red, violet to the Rossler system.

The following are my questions:

Question 1) How to generate colored noise in general?

Question 2) How to add the colored noise in the form of process noise to the Rossler system or any continuos time system and which method to use for solving the system -- ODE or Euler Maruyama?  Is the noise added Rossler system stochastic or not?

The code below is for integrating the Rossler system using ODE45 solver.

clc;
clear all
%%%% Number of variable and initial conditions:

nbvar=3;
xini=ones(1,nbvar)/10;

%%%% Time parameters:

trans=100;
tend=500;
tstep=0.01;

b=0.2;   % (default value for chaos)

ttrans = [0:tstep:trans];
tspan = [0:tstep:tend];

x0=xini;
option = [];
[t x] = ode45(@dxdt,tspan,x0,option,b);

plot3(x(:,1),x(:,2),x(:,3));
xlabel('X','fontsize',18);
ylabel('Y','fontsize',18);
zlabel('Z','fontsize',18);
box on;

% ===================================================================
% dxdt
% ===================================================================

function y = dxdt(t,x,b)

%%% parameters

a=0.2;
%b=0.2;
c=5.7;

%%% equations

y = [
     -x(2)-x(3);            % dx/dt
     x(1)+a*x(2);           % dy/dt
     b+x(3)*(x(1)-c);       % dz/dt
] ;


texts: Problem to implement a sinusoid oscillator in matlab

texts:
I'm pretty new in dsp and I'm having tough times trying to get the output for a simple digital oscillator. I'm starting from the recursive formula $y[n]=x[n]+a \times y[n-1]-b \times y[n-2]$, and need to figure out the values of $a$ and $b$ for the output to be completely sinusoidal at a determined frequency $\omega _0$ when an unit impulse is applied as input. I can't get the theory too much and the code I wrote just doesn't work at all. I would appreciate a lot with your help with this, cheers.

The code I've tried so far:

n=0:2*pi/200:2*pi;

w0=pi/16;

f=w0/(2*pi);

beta=1;

alpha=2*cos(w0);

num=1;

den=[1 -alpha beta];

x=[0 0 1 zeros(size(n))];

y=zeros(size(n));

y(1)=0;

y(2)=0;

y(3)=sin(w0);

for i=3:size(n)

    y(i)=x(i)+alpha*y(i-1)-beta*y(i-2);

end

y;

stem(n,y)

Thanks very much


texts:
For observation $y$, channel coefficient $h$ and gaussian noise $w \sim \mathcal{CN}(0,\sigma^2)$,

$$y = hx + w \tag{1}$$

Note that for OFDM system, (1) is assumed channel input-ouput equation on each subcarrier after DFT. Without loss of generality, let assume $x$ is BPSK or QPSK modulated.

My question is about the usage of channel equalizers. The first one is Least Square equalizer: $y' = y/h, \tag{2}$

and the second one Linear MMSE (LMMSE) equalizer, which coincides with MMSE equalizer for Rayleigh channels,: $y' = y \frac{h^*}{||h||^2+\sigma^2} \tag{3}$

I agree that if we hard-decode $y'$, LMMSE equalizer has better Bit Error Rate (BER). However, as modern receivers use soft decoding, we need to calculate Log Likelihood ratio (LLR),

$$LLR = \log\frac{p(y|x=+1)}{p(y|x=-1)}, \tag{4}$$

which depends on (1), somehow related to (2) in computing (4), and it is completely unnecessary to do (3).
Therefore, could I say that the LMMSE equalizer is useless? Here I have assumed we have perfect channel estimation, but I doubt that the use of (3) is justified even with erroneous channel estimate.

(I can write down mathematical derivation of (4) using both (2) and (3) to show that the final results are identical. However, I think it is obvious enough with the above arguments.)

I appreciate any explaination and paper reference.


texts: What are the pros and cons of common modulation techniques?

texts:
What are the pros and cons of commonly used modulation techniques? Why is one preferred over another in a given situation? Why do so many exist? Are some better at resisting noise, travelling long distances, packing more data?

Analog

Amplitude modulation
Frequency modulation
Phase modulation

Digital

Phase shift keying
Frequency shift keying
Amplitude shift keying
Quadrature amplitude modulation
Orthogonal frequency division modulation
Direct sequence spread spectrum

*And any other major ones I missed in the list above


texts: Calculating normalized edge frequencies for filter design in Matlab

texts:
What is the proper formula for converting ordinary frequency to normalized edge frequency in matlab for use in filter design commands like cheby2 etc
The wikipedia page shows three different formulas for normalized frequency,i higlighted all those in attached snapshot
And Matlab magnitude plot has written  (x pi rad/sample) below plot,and i highlighted that also.
So which one of three formulas of wikipedia ,should we use in Matlab?


texts: Optimize online weighted kurtosis algorithm

texts:
I am currently working on a Simulink block designed to perform an online computation of the weighted kurtosis typical of a certain signal. This block is part of a larger control algorithm, which will then be compiled as a DLL and run in both simulations and lab tests.

So far the Simulink block diagram is as follows.

The circular buffer performs the following

function y = fcn(u,bufferIC,bufferLength)
persistent buffer;
if isempty(buffer)
    if isequal(numel(bufferIC),bufferLength)
        buffer = bufferIC;
    elseif isscalar(bufferIC)
        buffer = bufferIC*ones(1,bufferLength);
    else
        error('IC must either be scalar or the same dimensions as buffer length')
    end
end
% Output
y = buffer;
% Update
buffer = [u buffer(1:end-1)];
end %fcn

and the weighted kurtosis will then be calculated according to the following algorithm:

function WKurt = fcn(BuffSig)
N = length(BuffSig);
y = (1.005.^(1:N));
weights = 2*(y/max(y));
WMean = sum((weights.*BuffSig))/sum(weights);
WStd = sqrt(sum(weights.*((BuffSig - WMean).^2))/sum(weights));
WKurt = squeeze(((sum(weights.*((((BuffSig - WMean)./WStd)).^4))/sum(weights))) - 3);
WKurt(WKurt<0) = 0.0;
WKurt(isnan(WKurt)) = 0.0;
WKurt(isinf(WKurt)) = 0.0;

If I run simulations, everything is alright and I do not happen to run into any CPU computation issue. That does not hold valid as soon as I move to lab tests, which will be terminated because the block requires too much CPU memory.

Therefore, I would very much appreciate whether a work-around exists so as to achieve the same kurtosis estimation, but in a more CPU-effcient way.


texts: Multiple parallel IIR bandpass filters with different centre frequencies combined into one filter for optimisation... possible?

texts:
Before I begin, I have read these already:

IIR filter parallelization
Concept of combining multiple FIR Filters into 1 FIR filter

I am processing audio using Csound in a high performance real time environment. One part of my code uses 10 butterworth bandpass filters in parallel, each with a different centre frequency and bandwidth. However, the centre frequencies and bandwidths are all relative to each other. The centre frequency of each filter are set whole number multiples or divisions of the main filter's centre frequency (ie, if main filter has cf of 100Hz, the other filters cfs would be 200, 300, 400, 500, 600, 50, 33.333, 25, and 20). The bandwidths of each filter are all a specific division of the associated centre frequency (ie, cf 100 = bw 10, cf 200 = bw 20, etc).

The main centre frequency is not fixed, but seeing as the filter centre frequencies and bandwidths are all relative to the main filters centre frequency and bandwidth, could I design a filter that combines all these filters into one? And most importantly, if I could, would it make any major difference to performance?

My best guess as to how to achieve this would be to combine the filter equations into one. I don't know if this would actually work, but if it did, I don't feel like it would improve the performance by much.

EDIT:

The sample being filtered is rich in harmonic and in-harmonic frequencies. It is borderline noisy, so the sum of the outputs of the BP filters is quite interesting, and the harmonies aren't always perfectly related. This quality I would like to keep.


texts: Filter output quantization - does this limit effective coefficient quantization?

texts:
I am implementing a filter in hardware, and the intended maximum data input is 16-bit. The question is, if the output is to be re-quantized to 16-bit, does this mean certain coefficients are effectively 'useless' - as outlined here:

The filter is a fractional delay filter (FIR), so for very small fractional delays some of the coefficients are very small, while the center tap is large. (large coefficient dynamic range)

In the current design the coefficients have been quantized - and in integer form, the smallest is +1, while the largest is 195890 so a range of 2 bit (signed) to 20 bit (signed).

So the question is - if I quantized the output to 16-bit, does this mean the smaller coefficients are effectively unused. For example, if I do an impulse response test, I will get zeros for any coefficients that are smaller than 4-bits, due to the fact the 20-bit coefficient sets where the MSB of the output is.

For practical data, I imagine these smaller coefficients may have a minor impact as they may effect the output - but it is interesting that the impulse response would show them as dropped.

Is there any guideline that says if the coefficients dynamic range is larger than the output bit-width, that they are effectively unused?

  Clarification of the question

Data-width is 16-bit, Largest coeff width is 20-bit, Smallest Coeff width is 2-bit.
Filter internal word-size is ~ 16+20+G, where G are the guard bits.
This full precision value is truncated/rounded to a 16-bit output.

Doing an impulse response test on this filter, I will see the larger coefficients, but the smaller ones will come out as 0, due to the fact the output can only take 16-bit, while the difference between the largest and smallest coefficient is 20-2 = 18 bit. Does this mean these smaller coefficients are not effective, given the impulse response 'cant see' them.


texts: Why are Peak filters called "Peak" and why are Shelving filters called "Shelving". I am not a native English speaker. So excuse me if it is so dumb question.


texts: Would it be possible to reconstruct 3d trajectory of ball projectile using only monocular video

texts:
Assume ball location on the image frame in each timestamp is given.

Would it be possible to reconstruct the ball's 3d trajectory in the camera's coordinate frame?

The ball should be able to described using constant acceleration model, as it only subject to gravity and initial throwing force

Edit: I am hoping if someone could points out whether it be possible to deduce the unobservable perpendicular motion, after some flying time


texts: Why does the FFT of a complex variable create negative frequencies?

texts:
So I have a demodulator that streams out X and Y values. I use a spectrum analyzer within this demodulator instrument which plots the |FFT(X+iY)| against the frequency domain, which shows up with negative frequencies. There is an equal number of frequency points in both positive and negative axis.

Whereas if I take the data of X and Y directly into MATLAB, perform the FFT of this, I only get the positive half of the frequencies as seen from the spectrum analyzer.

Excuse me if my question is vague, but I am still getting to grips with DSPs and would like to understand this more.

x = dev2305.demods.sample_x{1, 1}.value; %reading X values
y = dev2305.demods.sample_y{1, 1}.value; %reading Y values
data = complex(x, y); %Create complex variable X+jY
Y = fft(data);
P2 = abs(Y/length(data));
P1 = P2(1:length(data)/2+1);
P1(2:end-1) = 2*P1(2:end-1);

f = 109900*(0:(length(data)/2))/length(data); %109,900 is the sample rate

plot(f, mag2db(P1)); %dbV
%plot(f, P1);
title('Manual MATLAB FFT')
xlabel('f /(Hz)')
ylabel('FFT|xiy| / dBV')


texts: How to transform or distort or skew a rectangular image to fit arbitrary quad

texts:
I have a rectangular image which need to transform so the image fits an arbitrary convex quad. Easy? Except I have an important constraint, the features on the original image must maintain their relative area after the transformation.

I've tried a perspective transformation, but of course feature's relative area's change significantly with perspective.

The (hand-drawn) image below illustrates the effect I need. The original is on the left and the transformed is on the right. Notice that all 4 features maintain same relative area.

I would be happy with solution that maintained the areas approximately.


texts: Pink ($1/f$) pseudo-random noise generation

texts: What are some algorithms for generating a good pseudo-random approximation to $1/f$ (pink) noise, yet suitable for implementation with low computational cost on an integer DSP?


texts: Second (numerical) derivative as estimation of oscillation

texts: I have a discrete signal (vector of numbers) coming from a measurement. This signal has been filtered so that the noise has been removed. Now I am looking for an analytical representation of the signal (don't know if it is correct expression, I mean an analytical function that approximates the signal). My idea is to define an interpolation maybe using a spline. Any idea of how I can extract nodes from the vector to define a spline with a specific approximation? Can I consider the second (numerical) derivative as an estimation of the oscillation?


texts: How to add repeated beeps to sound created with a pause in between each beep in MATLAB

texts:
I have 2 sounds that I created and trying to make them beeps. Maybe 4 or 5 repeated beeps but have a pause in between each beep but make it still part of the signal. I think I have it so that the sound is a single frequency but just need make it a repeated with pauses and still part of the same signal. Any help would be appreciated I have the code listed below.

Fs = 44100;
N = 400;
t = (1:N)*(1/Fs);
freq = 600;

sound_array = zeros(N, 2);
%starts N x 2 matrix
sound_array(:,1) = sin(2*pi*freq*t);
sound_array(:,2) = sin(2*pi*freq*t);

%Left and Right channels

sound_L = sound_array;
sound_L(:,2) = 0;
sound_R = sound_array;
sound_R(:,1) = 0;
plot(sound_array);

%Sound 1
sound(sound_L, Fs);
%Sound 2
sound(sound_R, Fs);
%Play consecutive
sound(sound_array, Fs);


texts: Why is TV static noise always black and white?

texts:
Most modern day Cathode Ray Tube (CRT) televisions manufactured after the 1960s (after the introduction of NTSC and PAL standards) supported the circuit-based decoding of colored signals. It is well known that the new color standards was created to permit the new TV sets to be backwards compatible with old black and white broadcasts of the day (among also being religiously backwards compatible with numerous other legacy features). The new color standards added the color information on a higher carrier frequency (but at the same duration of the luminosity). The color information is synchronized after the beginning of each horizontal line and is  known as the colorburst.

It would seem that when you feed noise into a television, the TV should create not only black and white noise but also color noise as there would be color information at each new horizontal line where each frame should be. But this is the not the case as all color TVs still make black and white noise!

Why is this the case?

Here is an example signal of a single horizontal scan.

And here is the resulting picture if all horizontal scans are the same (you get bars!).


texts: Linear Block Codes Digital Communication Problem

texts:
How to design a $(8,4)$ linear block code with highest possible error correction and error detection capability?

I have studied linear block codes topic but if I do the conventional way, in case of $(n,k)$ block code, I need a generator matrix which is given as $\mathbf G=[\mathbf P|\mathbf I_k]$, where $\mathbf P$ is the parity matrix and $\mathbf I_k$ the identity matrix. But to find parity matrix I need to find the code words. But how to do that? Since third codeword should be the addition of first two code words.
Any kind of help will be appreciated.


texts: Simple, streaming, lossless image compression

texts:
Does anyone know of any image compression techniques with the following characteristics:

lossless
streaming - I want to compress on the fly, pixel-by-pixel.
low-memory overhead - I can afford to buffer a single line, but ideally not even that.
no dynamic dictionaries
"real-world" images only, so performance on "nasty cases" like chequerboards is not important
2-3x compression (5x-10x would be even better, but that's asking a lot I know)
can operate on 10-16 bit pixels (depending on my camera)

My images will be ~1k pixels wide, with pixel rates of ~20Mpix/sec.  The pixel depth will be something between 10 and 16 bits per pixel (depending on the choice of camera). Assume sub-16-bit pixel widths would be represented within a 16-bit word for now, rather than needing to be extracted from a continuous bit-stream.

Some form of delta+arithmetic coding perhaps?


texts: iPhone iOS UIImage how to detect a "laser pointer" dot on a camera feed?

texts:
I got a tracked robot toy and I'm controlling it with an iPhone. The robot outputs a live camera feed of a known frame size and I'm displaying it on UIImage.

I've added a laser pointer to the robot and fixed it alongside the axis of the robot. I'm trying to detect the laser pointer dot on the image and thus try to calculate the proximity of the object. If the laser dot is far away from the center, I know that the robot is stuck against the wall and needs to back up.

How can I go about detecting a dot of bright white-red pixels on a screen? One solution would be to sample the color of pixels within a certain radius of the center and detect a blob bright color. Can anyone suggest an algorithm for this activity?

Another approach would be to keep track of the average position of the dot over the last few frames, thus reducing the guesstimate radius. If there's no dot within a pre-defined region, the search region may be expanded.

Finally, I want to be able to teach the robot to detect carpet around it. Carpet reflects a laser pointer in a certain way, and I want to understand how many frames around the robot have similar properties. If I know where the laser pointer is at a screen, I can clip a small rectangle from that image and compare them one to another. Is there an efficient way of comparing multiple small images to one another to understand if their silhouettes match?

I noticed that the laser is reflected off glossy surfaces, and the direction of this reflection may tell me something about the orientation of the surface in space, in accordance with the laws of refraction.

Thank you!


texts: Periodic signal filtering: transform from frequency domain doesn't meet expectation

texts:
The signal in question is:

$$x(t)= \sum_{n=-\infty}^{+\infty} \text{rect}\left(\frac{t-4nT}{2T}\right)+\text{trian}\left(\frac{t-n4T}{T}\right)\quad\text{with}\quad T=1\,\textrm{ms}$$

Passes through a filter with frequency response filter:

$$H(f)= \text{rect}\left(\frac{f-375}{400}\right) + \text{rect}\left(\frac{f+375}{400}\right)$$

I must find the output signal $y(t)$ from the filter. I have calculated the Fourier transform of $x$:

$$X(f)=\sum\limits_nC_n\delta\left(f-\frac{n}{4T}\right)\quad\text{and}\quad C_n= \frac{1}{2}\text{sinc}\left(\frac n2\right)+ \frac{1}{4}\text{sinc}\left(\frac n4\right)$$

then I have post:

\begin{align}
Y(f)&=X(f)H(f)\\
&=C_1(\delta(f-250)+\delta(f+250))+C_2(\delta(f+500)+\delta(f-500))
\end{align}

and

$$y(t)= 2C_1\cos(2\pi250)+2C_2\cos(2\pi500)$$

According to my prof the correct answer is:

  $$Y(f)=\frac{1}{4}C_1(\delta(f-250)+\delta(f+250))+\frac{1}{4}C_2(\delta(f+500)+\delta(f-500))$$

why?


texts: OpenCV detectin skin colour invariant with illumination changes

texts:
I have to capture skin colour independent of illumination.
I used the following criteria(using hsv and rgb) but it ain't working:

int h = get_hue(...);
int s = get_saturation(...);
int r = get_red_component(...);
int g = get_green_component(...);
int b = get_blue_component(...);

if ((h<38)&&(h>6)&&(s>0.23)&&(s<0.68)){
    // skin color
}
else if ((r>95) && (g>40) && (b>20) &&
         ((maximum(r,g,b)-minimum(r,g,b))>15) &&
         (abs(r-g)>15)&&(r>g)&&(r>b)){
   // also skin color
}

It works in the morning when my skin is illuminated but by evening it does not work.

Any Help will be appreciated. Thanks in Advance.
(PS -my skin ain't white.)


texts: I am using the Peak to Correlation Energy (PCE) Metric to measure the similarity between two images using MATLAB. In some cases, the PCE value obtained is NaN. How can I solve this problem?


texts: converting higher order transfer function in s-domanin to the cascaded biquad transfer functions, also in s-domain

texts:
I'm trying to convert a transfer function (tf) in s-domain (num: b17*s**18 + b16*s**17 + ... + b0, den= s**20 + a18*s**19 + ... a0) to cascade of the biquad transfer functions, also in s-domain. That is my flow:

Convert s-domain tf with numerator (num) and denominator (den) to the
z-domain tf mit numd and dend:

[numd dend] = bilinear(num, den, f);  // f= resonance frequency of plant

Convert z-domain tf to the cascaded biquad filters:

[sos] = tf2sos (numd, dend);`

Finally Convert biquad filters from z-domain to s-domain, e.g. for the first
biquad: However before running d2c I generate H:

H = tf([0.2046 0.4251 0.2014], [1.0000 2.6487 1.7591], 1/fs)
                                      // fs = sample frequency

I get the following error:
    'Subscript indices must either be real positive integers or logicals.'

What is wrong? Is there any other way which is superior to my flow?

Thanks a lot in advance!


texts: Why is the close looped model under control called plant?

texts:
I am not sure if the question even belongs here. Please correct me if it is out of context.

Consider a closed feedback loop.

Usually, we say that $K^L(s)$ is a controller over the plat $G(s)$. Is there any reason it is called a plat?

The controlled system may be a car with cruise control, an actual plant, or even the famous F15. These are not necessarily plants. Was the theory originating from real plants and factories?

I am looking for something anchored in resources and not an intuitive explanation.


texts: I want to generate variable frequency, magnitude sine waves. How should i try this using MATLAB

texts: I am trying to implement constant V/F ratio control of Induction Machine and for doing so I want to generate variable frequency, magnitude sine wave. How should i begin using MATLAB


texts: How does the 'phase' of a cosine wave become 'pi' when it transitions from positive to negative?

texts:
I was watching this video lecture on filters where this professor says that:

  The phase of a cosine wave $\cos(\omega)$ is 0 till $\omega=\pi/2$. As soon as $\omega$ goes beyond $\pi/2$, i.e when $\cos(\omega)$ becomes negative, its phase becomes $\pi$.

I couldn't understand this. How can $\cos(\omega)$ have phase in itself if it is just a plain normal cosine function? What is the physical interpretation of this phase?


texts: Code generation for `sum` function in MATLAB

texts:
In cross correlation we use the below command to calculate the sum after elementary multiplication of the vectors. But when we try to convert this Matlab code to vhdl using HDL coder, this command is not defined by HDL coder. Is it possible to write code for below line without using 'sum' builtin function please.

xc(i)=sum((y1(j1:k1)).*y2(j2:k2));

where j1, j2, k1 and k2 are the starting and ending limits.
y1 and y2 are two vectors and are being multiplied element wise and the result is being added.

Thanks


texts: Image watermarking in wavelet domain (data hiding in images)

texts:
I am working and researching on Image watermarking/steganography and I'm stuck at a point and want to know which technique is better in image processing for data hiding.

Bit Plane Complexity Segmentation OR CDMA Spread spectrum.

Can some experts give their opinion on both techniques and which one is better and why? like advantages and disadvantages or comparison of both

Thanks a lot.

So, I just want to hide some text in a color or grayscale image using wavelet trasform.

I could use either bpcs or cdma spread spectrum technique. I want to know which one should go for and why.

This is for learning purpose and no particular application.

Thanks. Please let me know if u need any specific info.


texts: Calculating information loss in a signal after smoothing?

texts:
I have a signal. I applied Gaussian smoothing to it and then for baseline reduction I appied Tophat filter to the smoothed version.

This is the original signal:

This is the final signal:

I read that KL Divergence helps in finding the information loss between two signals but then again a condition was that the elements of the two distributions must be 1 i.e. There are two distributions P & Q then Pi + Qi = 1.

So is there any other way by which I can do that ?


texts: Relation between Wireless Power Transfer, Wireless Information Transfer and the definition of sum rate

texts:
I read this paper Charge-then-Forward: Wireless Powered Communication for Multiuser Relay Networks
 ,and it said it on the second page ,and I don't really understand why is the theory ,the author said, right.

  the time of WPT, Wireless Power Transfer, should be as small as possible so that the time for wireless information transmission (WIT) can be maximized for sum-rate maximization

Does anyone know the definition of sum-rate in formula type and the relation of WPT and WIT? I think I can really understand reason if I know these first.


texts: Is a LTI filter completely characterized by its frequency response

texts:
I know that we use the frequency response to determine the properties gain and phase delay of a filter. However, I was wondering if this is enough for a complet characterization of the the filter for e.g. in terms of noise attenuation.

For example: I have a low pass filter. Am I guaranteed to attenuate e.g. colored noise?

Cheers,
rot8


texts:
Does including log distance path loss to a communication system cause a drastic difference to the BER of the system?

In other words, if I have a simulation for a communication system without path loss, does the BER vs SNR curve differ drastically when I add path loss or should both the BER vs SNR curves(with and without path loss) look similar?


texts:
I'm using MATLAB Training Image Labeler app for labeling images and exporting the regions of interest  (ROIs) which I save in .jpeg files.The ROIs are exported as a structure $1\times 430$ with two fields (name and objectBoundingBoxes, containining the ROI $[x, y, \textrm{width}, \textrm{height}]$ information). I would do the same job but for the area out of the ROI (background). Is it possible to save the background, using a similar method?

My purpose is obtaining the rectangles around the ROIs so I can label them as background. In the dataset I can have multiple ROIs for single image, so the best solution would be obtaining upper, left, right and lower rectangles of the proposed ROI.


texts:
I have created a Low Pass filter (I am trying to understand the topic of DSP, and it's hard.. But moving along with samples, books and a nice post on Stack Overflow).

I am saving the 'output' to a file, and I hear a constant clicking noise (very rapid, medium-pitch). The volume (intensity) of the 'clicking' gets louder as there is more intensity (in the passband of my filter).

I have been reading something about possible Artifacts when designing filters (FIR), but I am wondering if this is the constant clicking noise I hear ? It's not bad for my system, because I try to measure the intensity of the 0..100Hz band, and the clicking increases when the low sound increases. But I am just wondering if it's bad, or a possible symptom of a flaw in my filter ?

Thanks!

My Filter (of-course the getLPCoefficientsButterworth2Pole() is called first):

double ax[3];
double by[3];
double xv[3];
double yv[3];

void getLPCoefficientsButterworth2Pole(const int samplerate, const double cutoff, double* const ax, double* const by)
{
double PI = M_PI;
double sqrt2 = sqrt(2);

double QcRaw  = (2 * PI * cutoff) / samplerate; // Find cutoff frequency in [0..PI]
double QcWarp = tan(QcRaw); // Warp cutoff frequency

double gain = 1 / ( 1 + sqrt2 / QcWarp + 2 / ( QcWarp * QcWarp ) );

by[2] = ( 1 - sqrt2 / QcWarp + 2 / ( QcWarp * QcWarp ) ) * gain;
by[1] = ( 2 - 2 * 2 / ( QcWarp * QcWarp ) ) * gain;
by[0] = 1;

ax[0] = 1 * gain;
ax[1] = 2 * gain;
ax[2] = 1 * gain;
}

void process(MTAudioProcessingTapRef tap, CMItemCount numberFrames,
         MTAudioProcessingTapFlags flags, AudioBufferList *bufferListInOut,
         CMItemCount *numberFramesOut, MTAudioProcessingTapFlags *flagsOut)
{
OSStatus err = MTAudioProcessingTapGetSourceAudio(tap, numberFrames, bufferListInOut,
                                                  flagsOut, NULL, numberFramesOut);

if (err)
    NSLog(@"Error from GetSourceAudio: %ld", err);

float leftVolume, rightVolume;

NSLog(@"Test: %f", xv[1]);

for (CMItemCount i = 0; i < bufferListInOut->mNumberBuffers; i++) {
    AudioBuffer *pBuffer = &bufferListInOut->mBuffers[i];
    int cSamples = numberFrames * pBuffer->mNumberChannels;

    float *pData = (float *)pBuffer->mData;
    float rms = 0.0f;

    for (int j = 0; j < cSamples; j++) {

        xv[2] = xv[1];
        xv[1] = xv[0];

        xv[0] = pData[j];
        yv[2] = yv[1];
        yv[1] = yv[0];

        yv[0] =   (ax[0] * xv[0] + ax[1] * xv[1] + ax[2] * xv[2]
                   - by[1] * yv[0]
                   - by[2] * yv[1]);

        pData[j] = 20 * yv[0];
        rms += yv[0] * yv[0];

    }

    if (cSamples > 0) {
        rms = sqrtf(rms / cSamples);
    }

    if (0 == i) {
        leftVolume = rms;
    }

    if (1 == i || (0 == i && 1 == bufferListInOut->mNumberBuffers)) {
        rightVolume = rms;
    }
}
}


texts: I am unable to find out a formula for the BER for the OQPSK Modulation. Currently, I am using the berawgn function from Matlab to calculate the BER for OQPSK but I am looking for an expression for this BER. Pointers to any references would be appreciated


texts:
Lets say we have a transfer function from an LTI-system that goes as follows, and we want the impulse response for it:
$$\frac{10\cdot e^{\left(-\mathrm{i}\right)\cdot \pi\cdot f\cdot 8}}{5+\mathrm{i}\cdot 2\cdot \pi\cdot f}$$
The way I would approach solving this, would be to use the following fourier transform formulas:
$$\frac{1}{a+i2\pi*f}=exp(-at)*u(t)=\frac{10}{5+i2\pi*f}=10*exp(-5t)*u(t)$$
$$G(f)*exp(-i*2*\pi*f*t_0)=g(t-t_0)$$
$$exp(-i*\pi*f*8)=exp(-i*\pi*2*f*4) =>t_0=4$$
$$exp(-i*2*\pi*f*4)=g(t-4)$$
Which would end up with the following result:
$$\frac{10\cdot e^{\left(-\mathrm{i}\right)\cdot \pi\cdot f\cdot 8}}{5+\mathrm{i}\cdot 2\cdot \pi\cdot f}=10*exp(-5t)*u(t)*g(t-4)$$
However, this seems to be incorrect. Did I do an error with the fourier transforms, or have I misunderstood some of the formulas?


texts: best implementation of a real-time, fixed-point iir filter with constant coefficients

texts: I have implemented IIR filter in direct form, parallel form, and cascade form. The input in all the cases is a kronecker delta function. How to judge which implementation is better is in real time and why? What are the factors to be considered while selecting the best implementation? Please help.


texts: Why is generating $1/f^\alpha$ noise so complicated?

texts:
Why can't I just take the square root of the power spectrum $P(f) = Cf^{-\alpha}$, multiply with $e^{i\theta_n}$ ($\theta_n$ being $N/2$ random phases in $[0, 2\pi]$), and then do an inverse Fourier transform?  This can produce arbitrarily long time series with a $1/f^\alpha$ spectrum.  Quite obviously, I'm missing something.
EDIT: To be honest, I'm actually looking at methods to generate fractional Brownian motions (fBm).  An fBm is characterized by a power spectrum $P(f) = Cf^{-(2H + 1)}$ with $0 < H < 1$ being the Hurst parameter.  For example, a popular book on chaos theory by A.A. Tsonis (pp. 62-53) suggests the exact same method for generating an fBm trace:

How To Generate an fBM Trace with a Desired Spectral Density Function. A time series $X_i$, $i = 1, ..., N$, whose spectral density function satisfies the relation $S(f) = Cf^{-a}$ where $a = 2H + 1$, is obtained via the relation
$$x_i = \sum^{N/2}_{k=1} \left[Ck^{-a}\left(\frac{2\pi}{N}\right)^{1-a}\right]^{1/2}\cos{\left(\frac{2\pi ik}{N} + \phi_k\right)}$$
where $C$ is a constant and $\phi_k$ are $N/2$ random phases randomly distributed in $[0, 2\pi]$.

While this method is very simple, almost no papers on fBm generation discuss it.


texts: Matlab Plotting custom constellation along with decision regions

texts: How do I create a custom constellation along with decision regions in Matlab, any help is greatly appreciated


texts: How to calculate the Diagonal loading factor evaluate calculate the inversion of a covariance matrix

texts:
I am programming a Generalised Likelihood Ratio Test (GLRT) detector. When it comes to inverting a covariance matrix $Ri$, I need  to do a diagonal loading to fix the problem of sigularity of this matrix, but I don't have any info about the technique or algorithm that allows to estimate the right diagonal loading factor factor $\sigma$.

Rather than calculate inverse ($Ri$) I have to calculate inverse ($Ri  +\sigma \cdot I$) where $Ri$ is the covariance matrix.

Need help, please


texts: Is Fourier series a sampled version of Fourier transform?

texts: I recently learned about dtft and how dft/dfs is the sampled version of dtft. I was wondering if Fourier series is also obtainable by sampling Fourier transform? I am a noob in the subject so sorry if this is stupid


texts:
I don't know where to start from. and this question might be very silly,
I have found such as comment from someone at Poisson noise and curve fitting - denoise first?,
"I think if your noise is zero-mean it doesn't matter, if not it does (you should de-noise first). I'm not entirely sure though so I won't put it in an answer yet."
Q1. Actually, I want to know what does zero-mean noise mean? and what does it not matter means?
Q2. Why we presume that the noise in Gaussian filter have sigma 1 and mean 0 ?


texts: Mathematics of Harris corner point detection

texts:
This is the mathematical expression for Harris corner detection:

But I have the following doubts:

What is the physical significance of $u$ and $v$? Many references say it is the magnitude by which the window $w$ shifted. So how much is the window shifted? One pixel or two pixels?
Is the summation over the pixel positions covered by the window?
Assuming simply $w(x,y) = 1$ , $I(x,y)$ is intensity of the single pixel at $(x,y)$ or the summation of the intensities inside the window with center at $(x,y)$?
According to wiki they say the image is 2D , denoted by I and then asks to consider an image patch over the area $(x,y)$, then uses the notation $I(x,y)$

I am finding it confusing to grasp the mathematical explanation. Anyone has an idea?


texts: python: how to compute the sharpness features of image

texts:
I am extracting the sharpness features of image as shown in the following image mentioned in a paper.

I have done with the following code.
Firstly, use the open cv convert the RGB to HSL (luminance is L  mentioned in the paper), then get L array.
and then used the Laplacian operator to get the LP. Finally, obtain the sharpness value of image based on mathematical form in the paper.

img_HLS = cv2.cvtColor(image, cv2.COLOR_BGR2HLS)
L = img_HLS[:, :, 1]
u = np.mean(L)
LP = cv2.Laplacian(L, cv2.CV_16S, ksize = 3)
s = np.sum(LP/u)

I don't know my solution is right or wrong, if there is problem, please help me correct it. Thank!


texts:
This article here on the Window method for FIR filter design speaks of

  the total normalized bandwidth of the lowpass filter in $\textrm{Hz}$ (counting both negative and positive frequencies)

What is it?


texts:
according to the definition of the Fourier transformation we have for a real function:

if $F{{(a(t))}}$ = $A(f)$
then $F{{(-a(-t))}}$ = $-A$*$(f)$, with * for conjugate

import numpy as np
a= np.array([1, 2, 3,4,5,6,7,8,9,10])
a_mirrored = np.array(list(-a[::-1]))

A_f = np.fft.fft(a)
A_f_star = -np.conjugate(np.fft.fft(am))

So why is A_f different from A_f_star ? Can anyone tell please?


texts: How to find the period of a given signal?

texts: I'm new to Signal Analysis. I have a manually generated Signal from a Gyroscope, which looks like in the picture below and I need to extract the X-Values for each period. Is there some technique to automatically  find the X-Axis Values, where the period of the Signal repeats? If not, how would one proceed to somehow find the period?


texts: Understanding Soft Thresholding Operator

texts:
I want to understand what is soft thresholding operator? Why we use this operator? I came across this term while I was reading the paper - A New Algorithm Based on Linearized Bregman Iteration with Generalized Inverse for Compressed Sensing (at page no 4.).

Any reference that can explain this will also help me.

Thank you for your help.


texts:
I would like to know if the following method of 2x oversampling is correct:

Interpolate:

Take an original signal sampled at 44100Hz as input
Upsample by adding a zero after each original sample to get a signal twice as long
Filter the new signal using a low pass filter (cutoff of 44100Hz based on new sample rate of 88200Hz)

Use new signal:

Do some additional filtering of the the new signal at 88200Hz

Decimate:

Take the final signal at 88200Hz as input
Filter using a low pass filter (cutoff of 44100Hz based on sample rate of 88200Hz)
Downsample by removing every other (odd) sample
Now have a signal that is 44100Hz again

What I would like to check is if the method is correct and my cut off frequencies for my low pass filters are right.


texts: A-weighted Digital Filter for 1/3rd Octave Band Analysis

texts:
I want to do a 1/3rd Octave band analysis on a noise signal. But the sound pressure levels should be in dB(A), i.e., and it should be A-weighted.
For this, I am using the A-weight function from this module.
From this link, what I understood is that the function A-weight takes the input as a signal(in Pressure(Pa)), and sampling frequency and gives the output as another signal(in Pressure(Pa)). If This output signal converted into pressure level should provide the A-weighted pressure levels.
Now, I use the A filtered sound pressure signal as my starting point and use the Butterworth filter to convert it into 1/3rd Octave Bands. Reference for this - https://stackoverflow.com/questions/56791652/1-3-octave-from-audio-file-with-python
The 1/3rd filter is as -

The output plot I get for the original signal(not weighted) is -

This is the correct output.
The output plot after applying the A-weights is:

This plot is not correct. The weights for each band should be:

Reference of this table
The method I am using is not giving correct results in the lower bands, and I cannot figure why.
I don't want to use the weights directly as I want a generally weighted signal for purposes other than just 1/3rd Octave Band Analysis too.
I am a beginner in DSP so that any help will be much appreciated. Feel free to suggest even alternative approaches for the A-weighting filter that can be executed in Python. Thank you


texts:
I have an unknown number of senors that sends the same pluse with different delays, the receiver receives a mixed signals. Is there any method to separate the signals and determine the number of sensors ?
Ps : I'm using MATLAB.


texts: Do Spread Spectrum technologies combat time-selective fading of a channel?

texts:
The Spread Spectrum technologies such as DSSS and FHSS are successful against frequency-selective fading because the original signal is spread to a larger bandwidth and different frequencies are used a different times.

Do these technologies also mitigate the problems imposed by time-selective fading?