texts: How to calculate time domain SNR using known sequence

texts:
I am using the following formula to calculate SNR of a real world complex baseband signal sampled at 1x Nyquist.
SNR      = Rxy(tm)^2 / [ Px*Py - Rxy(tm)^2 ]
SNR (dB) = 10*log10(SNR)

where
Rxy(tm) = peak of the cross correlation at time delay, tm
Px = power in reference signal
Py = power in received signal

I verified proper implementation of the formula using simulated real-valued and complex-valued signals with and without noise.
On real data the SNR estimates using the above formula are too low (by 10.0+ dB). I manually verified the actual SNR a few different ways. I used spectral analysis to visually measure the signal power to the noise floor. I also measured the signal power to noise power (when signal is off), and both of those techniques give me an answer closer to what I expect.
I am flummoxed as to why this equation is not working on real-world signals. Do I need to take the DC bias (mean of data) into account and add that back to the SNR estimate? If I do that then I get values closer to what I expect.
Reference: Formula came from Principles of Communications (Tranter, Ziemer) textbook


texts:
Let $x[n]$ be a periodic with fundamental period $N$ and $y[n] = x[kn]$ where $k \in \mathbb{N}$ and $k\ge2$. Is $y[n]$ periodic? What's the fundamental period of $y[n]$?

Here is my answer:
If $N = mk$ where $m \in \mathbb{N}$ then $y[n+m] = x[k(n + \frac{N}{k})] = x[kn+N] = x[kn] = y[n]$. So in this case the fundamental period is $\frac{N}{k}$. Otherwise simplify $\frac{N}{k}$ such that $\frac{N}{k} = \frac{m}{n}$ where $\gcd(m , n) = 1$. The fundamental period is $m$ since $y[n+m] = x[k(n+\frac{nN}{k}) ] = x[kn + nN] = x[kn] = y[n]$.
I don't know whether my solution is correct and rigorous enough. For instance how can we prove there is no smaller period?


texts: The desired frequency-response specifications

texts:
The complex function $ D (e^{-jw})$ is defined on the domain of approximation $\Omega$ .In most cases the domain $\Omega$  is the union of several disjoint frequency bands which are separated by transition bands where no
desired response is specified .We denote the union of all passbands by $\Omega^p$ and stopbands by $\Omega^s$. If the designed filter is to have real-valued coeffcients only the domain $\Omega\cap[0 ,\pi]$ is
considered,what is the type of coefficients which used in the domain $[0 ,2\pi]
$ or$ [-\pi,\pi]$?

Thanks in advance.


texts:
What tools to use for practicing elementary filter design?
Is MATLAB all there is?
Do I need some specific toolboxes?
What functions do I need?

I'm starting from the ground up in digital filter design and I thought that I need to decide on a program that lets me experiment with different filter designs (not pre-built functions, but rather self-written). Make plots and perhaps .wav outputs and such.

I'm looking for something higher level than C++, because I think the "design language" should allow for more rapid prototyping than the "implementation language".

The tools should facilitate the evaluation of filter designs.


texts: Subgradient Method for K-Means Like Problem

texts:
I want to solve k-means-like problem. But at first, I wonder that we can apply subgradient method to k-means problem.

We want to find the optimal clustering $S = (S_1,S_2,...,S_k)$ such that

$$ {\operatorname{arg\,min}}_S  \sum_{i=1}^{k} \sum_{\mathbf x \in S_i} \left\| \mathbf x - \boldsymbol\mu_i \right\|^2 $$


texts:
I want to calculate the frequency amplitude asymmetry between two signals, EEG signals in particular. As a result, I expect a value ranging from 0 to 1. I have some references regarding that, but it's not clear in my mind what I have to do in order to write a correct matlab code for it.
"EEG amplitude asymmetry differences were computed
as a ratio of differences in absolute power between two scalp
locations or  (A - B/A + B)* 200 where A and B are the
absolute power recorded from two different electrode
locations".
This is an equation I found from a paper, and this is my attempt writing a script on it

N = 2^12; % FFT points
x = EEG.data(2,1:N); %% reading data from 1st channel
xn = x*10^-6; % multiply with 10^-6 because values are in microvolts
y = EEG.data(3,1:N); % reading data from 2nd channel
yn = y*10^-6; % multiply with 10^-6 because values are in microvolts
Fs=250; % sampling rate
Ak1 = abs(fft(xn))/length(x); % do FFT for 1st channel(amplitude specturm)
Ak2 = abs(fft(yn))/length(y); % do FFT for 2nd channel(amplitude specturm)
Ak1(2:N)=2*Ak1(2:N); % convert to one side spectrum
Ak2(2:N)=2*Ak2(2:N); % convert to one side spectrum
Pk1=Ak1.*Ak1; % compute power spectrum  1st channel
Pk1=Pk1(1:N/2); % use N/2 pts in spectrum 1st channel
Pk2=Ak2.*Ak2; % compute power spectrum  2nd channel
Pk2=Pk2(1:N/2); % use N/2 pts in spectrum 2nd channel
freqbin = round(15 / (Fs/N)); % random frequency bin
AA=(Pk1-Pk2)/(Pk1+Pk2); % amplitude asymmetry according to the equation above

Note*If I try to multiply the AA with 200 that gives me a value that is not between 0 and 1.

Thanks in advance for any help


texts:
Does it have one? The continuous variant does, $f'(t) \rightarrow j \omega F(\omega)$ - but $jkX[k]$ definitely isn't it for DFT.
To find it there must be a useful simplification of $\text{DFT}(x[n] - x[n-1])$, where $x[n] = \sum_{k=0}^{N-1} X[k] e^{j2\pi kn/N}$, while also accounting for the one dropped sample (x[0]) - and I cannot see such a simplification.

Note: $x[n] = ...$ above is for the definition of IDFT I use, rather than where the signal derives from. The signal should be assumed the most general possible; not periodic, can be complex or real, but must be finite.
Note2: see my answer for some important caveats to (and direct contradicting of) the accepted answer, and optionally the comments discussions below answers. Thanks to @CedronDawg for the detailed discussion.
Note3: "derivative" = finite difference (for sake of this question).


texts: Why is the PAPR of a single user SC-FDMA signal different than the PAPR of a  conventional single carrier signal if they both use the same modulation? Aren't they both single carrier signals?


texts:
Is $x(t)=t \cdot u(t)$ a power signal or an energy signal?
Please "show" me why - preferably using equations.


texts: Expected value of a Delta function times a function

texts:
I have a output signal $Y(t)= \sum_{n=-\infty}^{\infty} Z_n \delta (t-n\tau) h(t)$ and $Z_n$ is a random variable with equal probability to be $+-1$ and h(t) is $sinc(\frac t {\tau})$

and the Expected value of $Y(t)$ is

$E(Y(t)) = E[\sum_{n=-\infty}^{\infty} Z_n \delta (t-n\tau) h(t)]$

$=\sum_{n=-\infty}^{\infty}h(n\tau) E[Z_n]$

$=0$

But if I calculated in other way

$\int_{-\infty}^\infty t Y(t) dt$

$=\int_{-\infty}^\infty t \sum_{n=-\infty}^{\infty} Z_n \delta (t-n\tau) h(t) dt$

$= \int_{-\infty}^\infty  \sum_{n=-\infty}^{\infty} tZ_n \delta (t-n\tau) h(t) dt$

$= \int_{-\infty}^\infty  \sum_{n=-\infty}^{\infty} n\tau Z_n h(n\tau) dt$

$=  \sum_{n=-\infty}^{\infty} [n\tau h(n\tau)\int_{-\infty}^\infty   Z_n  dt]$

Why I have two different result with same signal? Thanks for any help.


texts:
For my application I am looking for a free, fast and scale-invariant template matching algorithm. The templates can only be scaled within the scene (no skew or rotation) and the scale is unknown. Scale can go up from 400% to 25%. All pictures are noise-free.

I have considered the following:

SIFT: Highest accuracy so far. However it is licensed and pretty slow (3sec)
ORB: Performance still not fast enough (1.5sec). Accuracy also poor on scaling.

What is the best algorithm in terms of accuracy for this particular problem? And which is the quickest? Are there any algorithms specially designed for this particular problem?


texts: Frequency spectrum of an amplitude modulated signal

texts:
I am talking about a DSB- Suppressed Carrier amplitude modulation.
Let message signal be $m(t)=A_m \cos{\omega_c t}$ and carrier signal be $c(t)=A_c \cos{\omega_m t}$
Then the amplitude modulated signal is
$$s(t)=m(t)c(t)$$
$$s(t)=A_c A_m \cos{\omega_c t} \cos{\omega_m t}$$
$$s(t)=\frac{A_c A_m}{2} \{\cos{(\omega_c+\omega_m) t} + \cos{(\omega_c-\omega_m) t}\} \tag3$$
In frequency domain $s(t)$ is

From eq 3 it is visible that two frequency components $\omega_c+\omega_m$ , $\omega_c-\omega_m$ are present.
Then in frequency domain $S(\omega)$ why isn't there an impulse at these locations ? (and at their negative frequencies, of course)


texts: How to generate AWGN with given power spectral density

texts:
I am a little unsure about the generation of a additive white Gaussian noise, so I would appreciate to hear from you if I`m doing it correctly.

My goal is to generate the time-domain noise correspondent to a noise floor of -135 dbm/Hz

The procedure I`m adopting is the following:

1 - Convert the noise floor in dbm/Hz to Watts/Hz
2 - Get the average total power from the PSD.
3 - Generate the Gaussian noise with this average total power
4 - Take the FFT of the Gaussian noise and estimate the periodogram to verify whether it is indeed generating the noise with the correct PSD

Here is how I do the 4 steps above:

1 -
\begin{align} S_\text{watts} = \left(10^{\frac{S_\text{dBm}}{10}}\right)10^{-3} \end{align}
where $S_\text{watts}$ is the PSD in Watts/Hz and $S_\text{dBm}$ is the PSD in dBm/Hz.

2 - Average total power is given by $$ P_n = S_\text{watts} B ,$$ where $B$ is the Bandwidth

3 - Generate the randn MATLAB function multiplied by $\sqrt{P_n}$.

4 -
4.1 Take the FFT of the signal, let`s say, $X(k)$.
4.2 Get the Energy Spectral Density (ESD) as $\frac{\left| X(k) \right|^2}{N}$
4.3 Get the PSD by simply dividing the ESD by $N$ (the FFT length)
4.4 I do not simply plot the $10 \log_{10}\left(\text{PSD} 10^3\right)$, since I believe this would plot the PSD in dBm/subcarrier. Instead of this, I plot $10 \log_{10}\left(\frac{\text{PSD}}{\text{tone spacing}} 10^3\right)$, in attempt to get the plot as dBm/Hz.

The code below is what I am using. Please, indicate if I`m doing any mistake.

clear all
clc

bandwidth = 106e6;                          % in Hz
sampleFrequency = 2*bandwidth;              % in Hz
noiseFloor = -135;                          % in dBm/Hz
awgnPsd = (10.^(noiseFloor/10))*1e-3;       % in Watts/Hz
noisePower = awgnPsd*2*bandwidth;           % in Watts

% Generate noise signal:
N = 4096;           % signal length
nSymbols = 1000;     % number of symbols with length N to be generated
noise = randn(N,nSymbols)*sqrt(noisePower);

% Verify PSD
toneSpacing = sampleFrequency/N;        % DFT tone spacing
ESD = mean(abs(fft(noise,N)).^2)/N;     % Energy spectral density
PSD = ESD/N;

% plot PSD
figure
plot(10*log10((PSD/toneSpacing)*1e3))


texts: Why only odd harmonics after non-linear amplification?

texts:
Why do I get only odd harmonics appearing? This not only happens at saturation of the transfer curve, but also in the linear portion of the curve.

I make a input signal that has too high power that it will saturate the transfer curve. The transfer curve below is for Amplitude modulation, I also have a transfer curve of the output phase change for each input signal level.

This is basically how I do it

My input signal, x(t), is the sum of two sine waves

For each point on the transfer curve above I apply Amplitude and Phase modulation by using this array

modulating_phasor[] = (power_out / power_in) * exp(i*phase_deviation)

Then I look at my input signal and lookup where its value matches the input power of the transfer curve and use that location in the modulating_phasor array

output_signal[] = x[t] * modulating_phasor[location]

This makes the output signal complex array so I take the absolute value and for parts that should be negative, I multiply that location on by -1 by finding the correct location on input signal.

I cant upload my code... but you get the idea of what I am doing right?

Now this is my output and no matter what my input level on my signal is i.e. whether I am in the non-linear part or linear part, I always get odd harmonics. I've also tried a different transfer curve. Only get odd again.


texts: What is the most computationally efficient way to generate 100 sine waves layered on top of each other?

texts:
Right now I simply do this (pseudocode)

for freq in freqs:
    for i in len(samples):
        samples[i] += sin(...)

Is there a better way? This is for outputting to a 16-bit WAV file, using C on an ARM7 device. The frequencies are actually the centers of FFT bins for a particular bin size.


texts: Frequency response equivalent to characterise transient response (to sinusoidal inputs)?

texts:
I am interested in characterising the time-dependent response of a system to a sinusoidal input.

The steady state response of the system is also sinusoidal, however I wonder if there is a standard way to represent the information in a manner that is more detailed than the Frequency Response Function to capture the transient information too (as a function of frequency input)?

E.g. The system where input: $s(t) = \sin(\omega t), 0 \le t < \infty $ gives output: $y(t) = (1+e^{-t}) \sin(\omega t), 0 \le t < \infty$.

The frequency response would be unity, and the impulse response could not be used to capture the transient behaviour?


texts:
I have a gray scale image produced by an optical photon simulation and I am trying to find the DC gain of the image using Matlab. For that, I simulate a slant edge image in the simulation where N number of photons are incident on the optical plate.

I use the edge image to find the line spread function of the edge by taking the first derivative of the edge spread function (LSF=diff(ESF)). Then I use the Matlab FFT function to find the DC gain at frequency = 0.

I am not sure if this method is correct or not. How do I correctly find the DC gain in my image?.


texts: Why do we need DFT when we already have DTFT?

texts:
We already have DTFT so why do we need DFT?
Please don't write DTFT is used for discrete, aperiodic signal which transfers in the frequency domain to periodic and continuous, but in DFT is discrete periodic transfer in discrete periodic, these things I already know.


texts: Removing specific frequency from a signal

texts:
How do you remove a specific frequency from a signal?

I have a signal which is basically a sine wave at 20hz with some randomness added to it. After the real fft I can clearly identify the peak in the 20th bin, but when zeroing this bin and those sorrounding it and converting back to time domain the whole signal is gone for good, where I would expect to see the "random" part of the signal more or less intact.


texts:
If anyone can help solving this exercise I'll be grateful. It's urgent.
(I've added my answer, but I think it's wrong)


texts: Convolution Offset and Factor in Frequency Domain

texts:
See this link. The following Convolution in Spatial domain code is written in C#.

private void SafeImageConvolution(Bitmap image, ConvMatrix fmat)
{
    //Avoid division by 0
    if (fmat.Factor == 0)
        return;

    Bitmap srcImage = (Bitmap)image.Clone();

    int x, y, filterx, filtery;
    int s = fmat.Size / 2;
    int r, g, b;
    Color tempPix;

    for (y = s; y < srcImage.Height - s; y++)
    {
        for (x = s; x < srcImage.Width - s; x++)
        {
            r = g = b = 0;

            // Convolution
            for (filtery = 0; filtery < fmat.Size; filtery++)
            {
                for (filterx = 0; filterx < fmat.Size; filterx++)
                {
                    tempPix = srcImage.GetPixel(x + filterx - s, y + filtery - s);

                    r += fmat.Matrix[filtery, filterx] * tempPix.R;
                    g += fmat.Matrix[filtery, filterx] * tempPix.G;
                    b += fmat.Matrix[filtery, filterx] * tempPix.B;
                }
            }

            r = Math.Min(Math.Max((r / fmat.Factor) + fmat.Offset, 0), 255);
            g = Math.Min(Math.Max((g / fmat.Factor) + fmat.Offset, 0), 255);
            b = Math.Min(Math.Max((b / fmat.Factor) + fmat.Offset, 0), 255);

            image.SetPixel(x, y, Color.FromArgb(r, g, b));
        }
    }
}

Note the following lines:

    r = Math.Min(Math.Max((r / fmat.Factor) + fmat.Offset, 0), 255);
    g = Math.Min(Math.Max((g / fmat.Factor) + fmat.Offset, 0), 255);
    b = Math.Min(Math.Max((b / fmat.Factor) + fmat.Offset, 0), 255);

these lines are keeping the values of Red, Green, and Blue between 0 and 255. We are able change the values of Factor and Offset to control the contrast/brightness of the output image.

How can we achieve the same in frequency domain? I.e. how do we change the values of factor and offset in Frequency domain?

We know that a convolution operation in the Spatial domain is equal to the multiplication operation in Frequency domain. In frequency domain we are multiplying two Complex numbers. Which part of those complex numbers represent factor and offset?


texts: Using FFT to extract a specific frequency range in Matlab?

texts:
I have a signal and from that I want to extract a specific frequency range, e.g. 10Hz to 15Hz. Now I heard that I should use Fast Fourier Transformation.

I'm going to do that in Matlab, but I have no idea where to start. Is there any good example how I can do this by passing the original signal and the frequency band as parameter?


texts: Circular convolution of a non causal signal

texts:
I know how we compute the $N$ point circular convolution of a two causal signals, but what about a signal such as $\{1,-1,2,1\}$ where, the position of 2 is the $0^{th}$ index and the other sequence is $\{2, -1\}$ which we can assume  to be causal, what about the 4 point circular convolution. According to me it is

$$\begin{bmatrix}1&1&2&-1 \\-1&1&1&2\\2&-1&1&1\\1&2&-1&1 \end{bmatrix} \begin{bmatrix} 2\\-1\\0\\0\end{bmatrix} =\begin{bmatrix} 1\\-3\\5\\0\end{bmatrix}$$
With the position of 5 being the zeroth index because only then the 2 from the first signal got multiplied with the 2 of the second signal, giving off the zero position. But now I am confused, as to how to arrange the other indices. Can anyone help me out?


texts: What happens if we change the limits of integral in Fourier transform?

texts:
By definition of Fourier transform

$$X(\omega)=\int_{-\infty}^\infty x(t) e^{-j\omega t} dt $$

Now what will happen to the answer of transform  for example in case of $x(t)= \cos(\omega_0 t)$  if limit is $0$ to $A$ instead of $-\infty$ to $\infty$?

For $x(t)=\cos(\omega_0 t)$ its fourier transform is given by $ X(\omega)= \pi[\delta(\omega-\omega_0) + \delta(\omega+\omega_o)]$

so if the limit is changed will it effect the answer?


texts: finding period with autocorrelation is not correct

texts:
I have recorded a signal, which I know is periodic (apart from noise). The period length is unknown. I want to extract the last period from the signal. Before going to a noisy signal, I first tested the method on a self-created noiseless signal. I've read that the autocorrolation is the way to do this, but it did not work for my example. Let me show you what I have done.

First I created a periodic signal of 1000 samples with the Matlab code below:

N_period = 1000;
start_time = 0;
end_time = 1;
dt = (end_time-start_time)/N_period;
fs = 1/dt; %sample frequency
t = start_time:dt:end_time-dt;
y_period = sin(2*pi*t);

I then extended the signal in order to be longer than one period, but smaller than 2 periods:

y = [y_period(0.7*N_period:N_period), y_period];

I know, by construction, that I need to get the last 1000 samples to extract the last period out of the signal.

I first pad the signal with zeros, and then apply the autocorrelation

y_cor = [zeros(1,N), y, zeros(1,N)];
[autocor, lags] = xcorr(y_cor);
figure;
plot(lags, autocor)
grid

As can be seen in the figure below, the second largest peak appears at lag=946 and not at lag=1000.

If the method does not work for a noiseless signal, how can it then work on a noisy signal? Did I do something wrong? How can I improve this?


texts: Digital filters with more zeros than poles

texts:
I am having trouble wrapping my head around digital filters with different orders of numerator and denominator.  Let me know if any of these points is wrong:

All (digital or analog) transfer functions have the same number of poles and zeros, if you include the ones at infinity.  So $H(s) = 1/s$ has a pole at the origin and a zero at infinity, which is important for visualizing the amplitude response surface in the S plane.
But usually when we say "number of poles" or zeros we mean finite poles or zeros.  So $H(s) = 1/s$ is considered to have one pole and no zeros.
Digital filters designed by bilinear transform from analog filters always have the same number of poles and zeros (and none are ever at infinity).  But digital filters can also be made with different orders of numerator and denominator.
To find the poles and zeros of a digital transfer function in the general case, you first must express it as positive powers of z ("controls engineer format") and then find the roots of the numerator and denominator, same way as an analog filter.  So for example, a single-sample delay in "DSP engineer format" $H(z) = z^{−1}$ is rewritten as $H(z) = 1/z$, which shows that it has a pole at the origin and a zero at infinity, so it's considered to have "one pole and no (finite) zeros".

So then I become confused:

FIR filters are described as "all-zero filters". 1 2 They can be represented as a transfer function like $$H(z) = b_0 + b_1 z^{-1} + b_2 z^{-2}$$  But if you convert to positive powers of z to find the poles and zeros, you get: $$H(z) = \frac{b_0 {z}^{2} + b_1 z + b_2}{z^2}$$ which has just as many poles at the origin as there are zeros.  What is the significance of these poles?  These are each the $H(z) = z^{−1}$ delay elements used to produce the feedforward signals?  Seems like the poles end up at the origin if the delay elements are not fed back to the input?  So FIR filters are not actually all-zero filters?
Similarly, maxflat filters (Selesnick-Burrus generalized Butterworth) are described as having "more zeros than poles", which is supposed to be computationally advantageous.   (Why?)  The Matlab example produces b = [0.0950    0.2849    0.2849    0.0950] and a = [1.0000   -0.2402].  I think this is "negative powers of z" format, so this would represent a transfer function $$H(z) = \frac
{0.0950 + 0.2849 z^{-1} + 0.2849 z^{-2} + 0.0950 z^{-3}}
{1.0000 - 0.2402 z^{-1}}
$$
But again, if you convert to positive powers of z, you get: $$H(z) = \frac
{0.0950 z^3 + 0.2849 z^2 + 0.2849 z + 0.0950}
{1.0000 z^3 - 0.2402 z^2}
$$ which has 3 poles again, 2 of which are at the origin.  So the number of poles and zeros is again the same, and they're all finite, too.

If adding a zero to a digital transfer function always also adds a finite pole, I don't understand how a filter with "more zeros than poles" can exist, or be advantageous.  Might as well use those poles to affect the frequency response if you have them?

Is there some convention where poles at the origin are not included in the tally, like the way poles at infinity are not included?  If so, why?


texts: How to sketch the following discrete time signal $\sum_{k=0}^{n} \delta[n-k]$?

texts: I tried to solve it like in the picture but It feels so wrong though.


texts: Loop Bandwidth for Carrier Demodulation loop

texts:
I am trying to implement a simple MATLAB model for the demodulators for phase modulated signals (PSK) used in communication systems.

For the detection of the phase modulated output (PM out in the above figure) the bandwidth of the demodulator should be sufficiently lower than the symbol rate (modulation bandwidth) so as to ensure that the PLL is not able to track the modulation. But clearly, low frequency phase noise will be tracked which is the benefit of this demodulator.
Since the demodulator is working as a high pass filter, I assume this can be implemented with just a high pass filter in MATLAB.
I generate the input data as follows:

data = randi([0 7], 1e6,1);
modData = step(pskModulator, data);
scatterplot(modData);

I assume that my symbol rate is 1GS/s and since we want the loop bandwidth to be much lower, I keep it at 100kHz. I generate a high-pass filter as follows:

[b,a] = butter(1,100e3/1e9,'high');
H = tf(b, a, 1/1e9);
freqz(b,a)

Clearly close to 1GHz the filter reaches its pass-band.
MY QUESTION
My issue is that if I pass my input data through this filter, it still gets filtered out. I check it as follows:

angle_out = arrayfun(@(x) angle(x), modData);
angle_out_loop = filter(b,a,angle_out);
out = exp(1i*angle_out_loop);
scatterplot(out)

What am I doing wrong here? How can I make a filter which filters the low frequency noise but not the signal?
Although I have assumed 1GS/s as my symbol rate but how does MATLAB know that the random input data is indeed coming at 1GHz so that the data doesn't get filtered?
I have read similar qustions:Loop Bandwidth for symbol timing recovery but they were less implementation specific.
Thanks!


texts: Interpretation of instaneous time and instaneous frequency in time-frequency plane?

texts:
In this paper: Sparse time-frequency representations,
Given signal $x(t)$, the time-frequency representation was got by Gabor transform and was denoted by $\chi(t,\omega)=|\chi(t,\omega)|\exp(\mathrm{i}\,\phi(t,\omega))$.
Then it give two quantities:

instantaneous frequency:$$\omega_{ins}(\omega,t)=\frac{\partial\,\phi}{\partial\,t}$$
instantaneous time: $$t_{ins}(\omega,t)=t-\frac{\partial\,\phi}{\partial\,\omega}$$

My questions is:
I have learned the interpretation of instaneous frequency of a signal $x(t)$ and the group delay of a filter $H(\omega)$, but I do not know how to interpret these two quantities in time-frequency representation. Any kind of thought is welcomed.


texts: What are decision feedback equalizer advantages over linear eq?

texts:
I am studying linear and DFE equalization theory. So, the books and the Internet are saying, that linear equalizer uses to inverse z-domain channel function. That means that fir in z-domain with $H(z)$ turns channel tansfer function to $C(z)=1/H(z)$ in the case for no AWGN.  I understand it this way: For example, for channel taps $h_1=0.4;h_2=-0.02;$ we have z-domain function $H(z)=0.4-0.02z^{-1}$. And the inverse (with given the delay) of this can be presented as: $C(z)=\frac1{z^{-2}H(z)}=\frac1{0.4z^{-2}-0.02z^{-3}}=2.5z^{-2}+\frac18z^{-3}+\frac1{160}z^{-4}+R(z)$ where $R(z)$ is the approximation error. Here we can see that first fir coefficient $2.5z^{-2}$ works like a noise gain, and so, that is the main disadvantage of the linear eq.
   It is also said that decision feedback equalizer does not use to gain power noise in spectral nulls. Can anyone tell me how it does this?  What are the advantages of DFE over linear eq? Which types of the ISI feedfworward and feedback filters use to compensate?
Sorry for my English.
Any help will be really appreciated!


texts: Beginner's question on LPF, Need for Sinc and windowing

texts:
As a student who has never constructed any real world DSP application, I am inclined to ask the following.

Convolution in time domain is multiplication in frequency domain.
For low pass filtering, it is recommended that convolution of input signal [or rather samples of input signal] be performed with a sinc signal.
The frequency spectrum(or response) of a non-causal sinc signal is a perfect rectangle.
On computers, the non-causal sinc must be made causal and finite because of memory constraints. This mildly damages the frequency response of the filter.
And therefore in time domain, the truncated sinc is to be multiplied with a window function to repair the frequency response.

Now,

a. If the number of samples fed to a filter were fixed and known apriori (e.g. N)

b. It would be fairly trivial to construct an ideal frequency response H(N)

c. Multiply the input and filter frequency response and perform IFFT on the product.

d. The multiplication of the frequency responses "surgically" removes unwanted frequencies.

So why bother about sinc function and multiplying it with window function when multiplication in frequency domain is more than adequate? Or rather, under what circumstances is convolution in time domain performed?


texts: Simulation of FMCW radar in frequency domain

texts:
I would like to simulate a FMCW radar in the frequency domain. I used the code (Matlab) I attached below. Specially I am interested in the phase spectrum of the beat signal. In a further research I would like to calculate the response of the FMCW signal when it is hitting a dielectric slab. But for now I want to start with a simple example, a single target in a certain distance.

I believe the code is working, but I have the following problems:

The phase spectrum over the range is depending on the sample frequency. Why is that and how can I avoid that?
I am not quite sure if the phase response over the range is correct, does anyone have an idea what to expect?
This is just an 1-D simulaion, but in the future I want to extend it to 2-D. Is there a way to run the code faster?
Is there another way of attacking this simulation problem in Matlab?

Thanks Pavel

%%
function ProperShiftChirp

clear all; clc;
%generate FMCW Signal
c=299792458;

f_start=65e9;
f_end=90e9;
fc=80e9;

lambda=c/fc;

B=f_end-f_start;
T=4e-6; %Duration for one sweep;
PRI=T;

R=0.5; %distance target [m]
td=R/c; %roundtrip simple [s]

fs=2*B;
slope=B/T;

t=-T/2:1/fs:T/2;

%Generate ChirpSignal
sig_transmit=exp(1i*(pi.*slope.*t.^2));

%frequency domain
a=nextpow2(length(sig_transmit));

xfft=fft(real(sig_transmit),2.^a);

%scaling frequency domain
df=fs/length(xfft);

freq=(0:df:fs-df);

% transfer function
absxfft=abs(xfft);
phasexfft=angle(xfft);

S=absxfft.*exp(1i.*phasexfft).*(exp(-1i*2*td*2*pi.*freq));

%mixing transmitted and received signal
erg=fftshift(fft(ifft(xfft).*ifft(S)));

%single band
idx=(length(erg)/2);
abserg=abs(erg(idx:end));
phaserg=angle(erg(idx:end));

meterabs1=(c*freq(1:idx+1))./(2*slope);

figure;plot(meterabs1,abserg);
xlim([0 R+0.2*R]);
xlabel('metre');ylabel('|S|')
figure;plot(meterabs1,(unwrap(phaserg)));
xlabel('metre');ylabel('rad')


texts:
I have some misunderstandings with Q format. Please help me in understanding this.

If I say Q8 [unsigned] then there will be $8$ fractional bits. Is it ? How can I represent a $1$ and $1.5$ in this case?
If I say Q8 [ signed ] then there will be $1$ sign bit and $7$ fractional bits. Here how can I represent a $1$ and $1.5$?
When I say Q1.7 means I have $1$ integer bit and $7$ fractional bits. And the minimum number I can store in Q1.7 is $-1$ and maximum number is $1-1/2^7$. Is this understanding is correct ?


texts:
Background
Python GCC-PHAT works for me really well in a quiet environment.
However, in a noisy environment, the results are no good. I want to locate a source of the sound of a known frequency range between x and y in a noisy environment.
The question
How can GCC-PHAT work on specific frequencies?
What I tried
In the gcc_phat I zeroed-out all but the frequencies between x and y. However, this zeroed out the tau result of gcc_phat function.


texts: Selecting a Digital Signal Processor for a Specific Image Sensor

texts:
I am working on developing a camera and I am trying to select hardware for the camera. I believe that I may need a digital signal processor to compress image data before it is transmitted to a computer or other device (MCU) . What I am trying to figure out is how to estimate the processing power needed given a specific DSP. For example I was considering the OV5670 Image Sensor. This sensor is capable of transmitting 5 megapixel image data at 30 fps. If each pixel is stored as a 10 bit value that means in total 1.5Gbps would be being transmitted to a digital signal processor of my choice. The reason I am doing compression is that my ideally the camera would record data and then upload it to a cloud based server. I think it would be ideal then for compression to take place before uploading the data to reduce bandwidth usage.
From here I am uncertain how to proceed. For example I examined the ADSP-BF529BCPZ DSP chip. This chip can execute instructions at a rate of 400 MHz. In the data specs it is specified that the processing core of this chip contains
"Blackfin processor core contains two 16-bit multipliers, two 40-bit accumulators, two 40-bit ALUs, four video ALUs, and a 40-bit shifter."
Now each MAC can do a 16 bit multiplication and accumulate the result in the 40 bit shifter. There are 2 such MACs. If I were trying to compress the data by taking a DFT and then selecting the largest coefficients then I could say to calculate a single coefficient in the frequency domain I would need to multiply each pixel by a value and then sum it. Between the 2 MACs this would take 2.5 million cycles for one coefficient of a single frame.
Based on the above calculations it seems unlikely that the selected chip would be able to handle the compression as I need it to. But at the same time I know algorithms exists such as the FFT which can drastically boost the speed of the DFT.
What I am looking for is either confirmation that my current intuition into selecting a DSP chip is correct or alternatively that I am over/under-estimating the capabilities of DSP chips. In the later case, if possible please suggest other methods for predicting the required processing power from a DSP for a specific image compression application.
Thank You in advance, if any additional information is needed please let me know. Also feel free to suggest other solutions to my problem. For example, if you believe that I do not need a DSP and could instead achieve my goals through either a MCU or an FPGA then feel free to make such a suggestion.
edit: Also if anyone looks at the datasheets for the above listed components you will see that the image sensor transfers data via MIPI-CSI2 protocol. Which the DSP chip does not support. I am aware of that shortcoming but it is not the main driver of my current question.


texts: How to apply watershed to segment images using matlab?

texts:
How to segment this image using watershed to retrieve only the people in the image ?

I have done the following so far :

Calculated a gradient

Calculated the watershed transform

My code:

  clear;
I=imread('inpaint.jpg');
I=rgb2gray(I);

hy = fspecial('sobel');
hx = hy';
Iy = imfilter(double(I), hy, 'replicate');
Ix = imfilter(double(I), hx, 'replicate');
gradmag = sqrt(Ix.^2 + Iy.^2);

figure, imshow(gradmag,[]), title('Gradient magnitude (gradmag)')
L = watershed(gradmag);
% Lrgb = label2rgb(L);
 figure, imshow(L), title('Watershed transform of gradient magnitude (Lrgb)')

I have been successful in apply the watershed

Wanted to know can i outline my objects in the original image so that it appears segmented ?


texts: Calculating similarity between bit strings/signal

texts:
I have a project I'm working on where I'm trying to efficiently compare sequences of binary data to determine how similar they are. Basically, a sequence might look like this:
1001010010100011110...

I spent a while on my own trying to come up with a way to do it because it's fun for me to work through problems like this on my own, and actually made some progress. Unfortunately, everything I came up with never quite worked; a solution that accounts for substitutions (bits that flip) is easy, but what keeps getting me is handling bits that are inserted or deleted, i.e.:
100101 -> 1000101

Trying to find a solution online keeps leading me here, and I keep coming across the term cross-correlation. I also see lots of interesting links on the wikipedia page for Time Series for calculating similarities. Unfortunately, at the moment, a lot of the math is unclear to me, and I can't efficiently go through and distinguish what the appropriate technique might be for my situation.

So I have two different approaches to my problem that I'm interested in learning about:

1) What method would you recommend for calculating the similarity between two bit sequences (typically 50 to 150 bits in length) that is robust to substitutions, insertions, and deletions?

2) I'm not sure this is possible, but is there some kind of distance metric(s) I can calculate independently for each signal that will allow me to group them together with actually doing direct pairwise comparisons?

For 1, I feel like cross-correlation might be the right approach, but I haven't gotten past just plugging sequences in R and seeing how it works for identifying lag. I know edit distance will work, but ultimately will want something more efficient. Eventually, I will be trying to group billions of these together.

Thanks


texts: What's the best technique to determine if the contents of two images are the same?

texts:
I need to run comparisons on the output of hundreds of frames of simple 3D-rendered characters. Perceptually, many of the frames are exact duplicates. Based on this, I assumed something like a perceptual hash and comparison using pHash would work great. And in some cases it does...

However, I'm noticing that it doesn't tolerate minor (read: practically impossible for the human eye to see) color or contrast variations. Because of the nature of the rendered frames I received, there are some frames that are apparently different enough for pHash to conclusively decide that they are not the exact same.

Here are two example images along with a difference image:

pHash gives me a 0.473464% deviation between these images.

All those variations are enough to throw off pHash. Actually, pHash is able to tell that they are very similar, but I need a consistent low threshold to use for programmatic comparison. Other frames which actually deviate a tiny bit are sometimes considered more similar than the example above, even though they have perceptual differences. Which means I can't rely on pHash alone.

Here are two frames that are actually different (notice that his hands have moved a tiny bit):

Yet pHash gives me a difference percentage of 0.0188496%, which is less than 0.473464% from above, meaning that the frames that are perceptually different are actually considered more similar according to pHash.

I tried scaling and blurring the images a good bit to reduce any color variations, but I ended up having to do a ton of blurring to get closer. I don't want to do this too much, because I do want significant color changes to be considered as a unique frame.

For example, if there is a flash of light that illuminates the character, even if his character model is rendered in the exact same position, those frames should be considered unique:

Next, I tried Canny edge detection. This worked okay. Two problematic frames that are, for all intents and purposes, precise duplicates exhibited less differences:

The only issue I have with this method is that it only considers edges, which normally would be sufficient. If the character model changes at all, different edges should be detected. But this pretty much ignores significant color changes as mentioned above.

So my question is what is the best way for me to compare images like this and effectively counter insignificant color/contrast/noise variations? Seemingly pHash is ideal because of its perceptual nature, but I'm uncertain what I need to do as far as preprocessing to guarantee consistency from pHash (or some other algorithm, if it's better).

Any suggestions?


texts: For discrete wavelet transforms, is redundancy needed to ensure perfect reconstruction?

texts:
So I was using pywt and I noticed that in the padding mode documentation they explain the following:

  DWT performed for these extension modes is slightly redundant, but ensures perfect reconstruction.

So I was wondering whether for discrete wavelet transform this redundancy was needed theoretically or if it was an implementation choice. This person at pywt seems to think it is theoretical but I wanted to know why.


texts: Formula to compute output of a linear system

texts:
The impulse response is $h(t)=e^{-t}u(t)$  and input signal is $x(t)=1 + \frac{1}{2}cos(400πt)$

I want to find y(t)..

I tried to use $\int^{\infty}_{-\infty} h(τ)x(t-τ)dτ$ ,however i know that   $\int^{\infty}_{-\infty} h(t-τ)x(τ)dτ$  is equal.
Is this the correct formula?
I tried to solve it but couldnt find come up to a solution..

u(t) is the http://en.wikipedia.org/wiki/Heaviside_step_function


texts:
I'm reading a book where the autocorrelation of white noise is expressed as:

What is the term $Q(k)$ and why is is expressed as an average value of a dot product ?


texts:
Is there some learnable segmentation or learnable edge detection algorithm exist?

For example I mark N fotos by hands and than program "learns" how to do it best way and can do it on similar images.

there are some papers on this subject or source code?

Update:
I found some inforamtion supervised edge detection \ supervised segmentation
http://www.loni.ucla.edu/~ztu/Download.htm

but still looking for code.


texts: Rayleigh fading channel as a scalar quantity

texts: In most cases rayleigh channel is a vector. can a rayleigh channel be a scalar quantity i.e., can we have only one element in rayleigh fading channel.


texts: Calculating the variance of vibration acceleration

texts:
In a vibration measurement of a rotating blade, I have the following information. The vibration signal is measured using a ICP accelerometer which has the following specification

Measurement range: 50g
Sensitivity: 100 mV/g
Thus max output voltage: ±5V
Broadband resolution: 100*1e-6g

The variance of the acquired signal is
\begin{align}\DeclareMathOperator{\Var}{Var}
\Var_{aq}=\Var_{acl}+\Var_{adc}+\Var_{sig}\sim6.2e-4 g
\end{align}
$\Var_{acl}$: variance of noise in the accelerometer
$\Var_{adc}$: variance of the ADC noise (quantization, jitter)
$\Var_{sig}$ variance of the vibration acceleration of the blade.
Assuming that $\Var_{acl}\sim\sqrt{\text{broadband noise of accelerometer}} = 1e-8 \text{g}_\text{rms}$
From the specification sheet of the ADC, for the used input gain of 30db and sampling frequency = 51.2Hz, the var_adc = 1e-12 V_rms
Can anyone please help , how can I calculate the variance of vibtation acceleration of the blade i.e var_sig


texts: Shannon's entropy for non-equiprobable symbols

texts:
I am trying to understand the concept of Shannon's entropy and deciding the codelength. In first case, b is an array of 5 symbols. The symbol set is $\{1,2,...,8\}$. In general, there could be any integer value between 1 and 8 in b. For this data array, Shannon's entropy = NaN.

clear all
b = [1,3,2,6,1];
p_1 = sum(b==1)/length(b);
p_2 = sum(b==2)/length(b);
p_3 = sum(b==3)/length(b);
p_4 = sum(b==4)/length(b);
p_5 = sum(b==5)/length(b);
p_6 = sum(b==6)/length(b);
p_7 = sum(b==7)/length(b);
p_8 = sum(b==8)/length(b);

ShEntropy =  -p_1 * log2(p_1) - (p_2) * log2(p_2) - p_3 * log2(p_3) -p_4 * log2(p_4) -p_5 * log2(p_5) -p_6 * log2(p_6)...
    -p_7 * log2(p_7) -p_8 * log2(p_8)
%codelength
L = max(- log2(p_1), -log2(p_2), -log2(p_3), -log2(p_4), -log2(p_5), -log2(p_6), -log2(p_7), -log2(p_8))

For the otehr case, I am considering a binary arrays of symbols, d.

 d = [0,0,0];
    p1 = sum(d==1)/length(d);
    Shannonentropy_binary = -p1 * log2(p1) - (1 - p1) * log2(1 - p1)

I can see that when all the symbols are occuring then only there is a legal value for entropy, else it is infinite. But, in real life we cannot ensure that all the symbols would occur in a signal or some other data. So, my questions are

(1)for non-equiprobable sysbols, how can I calculate entropy without encoutering infinity value. Where am I going wrong?

(2) I need help in determining the L, the codeword length or the minimum number of bits required to encode a message. The optimal codeword length / block size should be $HN$ for $N$ number of messages. But, I need to know the value of $L$ which is the block size as I don't know how many number of messages, $N$ would be transmitted. Is there a way to find the exact value of $L$ without using the knowledge of $N$? I had remembered reading somewhere that the block size would be $\max\{-log2(p_i)\} $. What is the correct way?


texts: Analytical design of a bandstop Butterworth filter

texts:
I am trying to analytically design a bandstop Butterworth filter. I am trying to use:
$$|H(s)|^2 = \frac{1}{1+\big(\frac{s}{j\omega_1}\big)^{2N}}+\frac{1}{1+\big(\frac{s}{j\omega_2}\big)^{-2N}}$$
to derive a transfer function. I would like to know if I'm correct and how to proceed from here.


texts:
While studying spectrum analyzers I ran into the concept of RMS averaging as a mean to reduce dispersion of data without affecting power spectral density (PSD).

What is not really clear to me is how this is achieved: as per the calculation, I found that it is obtained by averaging the magnitude of the squared values of each FFT's frequency bin over a certain number of acquired traces. However, while the definition itself is not the problem and it is obvious that the dispersion of data will be reduced (it's an average), I don't see how the PSD can stay the same without being affected by such a computation.

------EDIT------

Here follows all I found on the subject (professor's online notes):

`` • Change of point of view: now we want to measure the power spectral
density of noise without reducing it

• Since we processed the input signal by truncating and sampling, also white
noise trace is displayed with a «noisy» spectrum

• In order to quantify the noise power density, it is useful to introduce the
RMS averaging, that is the average on the magnitude of the square value
of each frequency bin of the FFT performed on Np traces

• This technique reduces the dispersion of data displayed without changing
the PSD''


texts: Time delay estimate and sampling frequency

texts: This is an extention to my other question. My sampling frequency is only about 2x my tone frequency. I want to estimate time delay of arrival using this signal. I am generating the tone signal so I know its properties. Can I use compressed sensing to reconstruct my tone wave received by the sensors and get a good time delay estimate? An answer with some matlab code would be brilliant.


texts: Frequency extracted from MATLAB's $\tt fft$ is not very accurate

texts:
As a test I made up a sine wave in MATLAB of this form

y = 5*sin((2 * pi * freq).*x + 1.4) - 6;

where freq is 10 and x varies from $0$ to $1.5$ with a resolution of 1/1000 as shown below

fs = 1000;
x = 0:1/fs: 1.5 - (1/fs);

So I already know the frequency to be able to verify it with fft. After computing the amplitude FFT abs(fft(yy)), I find that the frequency bin with the highest magnitude is $16$. Since I have $1500$ samples which correspond to a sampling frequency of $1000$ then the 16$^\rm{th}$ bin corresponds to

$$\mathrm{\frac{Frequency \ Bin \times Sampling \ Frequency}{Number \ of\ Samples} = \frac{16 \times 1000}{1500} = 10.6667\ Hz}$$

However I know that my frequency I hardcoded is actually $10\ \rm Hz$. This can be repeated with different values and the same inaccurate result keeps occurring. And the smaller the hardcoded frequency the  larger the error in the result. Why is this happening?


texts:
Hello does any one know or at least can lead me to the right way?

What does not change pronunciation of words when someone is speaking. The idea is to create a app that checks if word/sentence is pronounced correctly. To do so I need something in pronunciation that does not change at all or changes in small range.

For example someone reads a text. His voice is recorded. Now someone else, who can not read so well reads it too. Then the recordings are compared to eacother. Then software displays on the computer screen how wrongly the second person pronounced.

Please do not suggest any software that does it!


texts:
I am stuck in a situation here while calculating received SNR in AWGN channel.

When I performed calculations directly in decibels, I got very high SNR value for instance 140 dB.

I am using the formula:

SNRreceived = [power transmitted(dBm) + FSPL(dB)]-[No(db) * B(hz) + 10log(KT) + NF(dB)]

Could anyone point out where am I mistaken or my formula is not correct?


texts: How to transform large set of audio samples using FFT?

texts:
Well, I am new to DSP so I apologize for the basic question. I am trying to transform audio 16bit PCM (which I store in normalized 0.0-1.0 range) samples into frequency domain using fft.

I understand that FFT transforms N points of time domain into two N sized frequency domain array. My problem is determining the size of N. For example if I have a 5mins PCM signal sampled at 8000 Hz/sec I can't find a way to get the spectrum of the whole signal, and not several arrays of size (e.g. 1024, 2048 etc..).

So my question is:

Can I transform the whole signal at once ?
If I cannot, is there away to combine the spectrum of different N sized segments?
Is it reasonable to study the spectrum of a whole large signal at once ?


texts: What proportion of a padded FFT should be actual values

texts:
For a given signal, I've been told that you can pad the vector with $0$s at the end to get a larger DFT, and as a result get more precision in frequency bins.

What are the limits to this approach?
Is there a loss of accuracy when you do this?
Or if not, why wouldn't you just use a small number of points and pad with zeros all the time?


texts:
There is a nice paper on explaining DFT from the 1960s in IEEE A guided tour of the fast Fourier transform. The author uses the following definitions of DFT
DFT
$$
X(j)=\sum_{k=0}^{N-1} x(k) \exp \left(-i 2 \pi\left(\frac{j}{N}\right) k\right)
$$
Inverse
$$
x(k)=\frac{1}{N} \sum_{j=0}^{N-1} X(j) \exp \left(i 2 \pi\left(\frac{j}{N}\right) k\right)
$$
where the indexes j = 0, 1, 2, ..., N-1 and similarly k=0, 1, 2,..., N-1.
Now the authors show a figure, where the j and k indices run from 0 to N not N-1. Let us say we had 10 data points, so N=10; and j and k should run from 0 to 9 not 10. Is this a typographical error in the figure?
It seems that his N also starts from zero, then the figure is consistent but the summation formula has N-1.


texts: Finding the inverse Inverse $\mathcal Z$-transform

texts:
I'm working through and learning about Inverse $\mathcal Z$-transforms right now, and I'm getting caught up on trying to find the Inverse $\mathcal Z$-transform of the following:
$$\sum_{k=1}^P\frac{1}{z^{60k+1}-az^{60k}}$$
I'm not really sure how to proceed. I'm trying to manipulate the equation by pulling out $z^{30k}$, but it seems to not be going anywhere. If anyone can point me in the right direction, I'd appreciate it.


texts: Why would super resolution using deep learning beat the old school techniques?

texts: I assume a standard/ old school super resolution techniques use Polynomial interpolation  and Upsampling approaches. Why would deep neural networks achieve better results?


texts: Inconsistency between the units of power spectral density and the definition that people often give

texts:
Perhaps someone can help me resolve something - this is my understanding:

In deterministic signal analysis, for a signal $x(t)$ the signal energy is defined by
$$E_{\textrm{s}} = \int^{+\infty}_{-\infty} |x(t)|^2\mathrm dt \hspace{1cm} \textrm{Units:}\hspace{0.3cm}[\textrm{signal}^2\cdot \textrm{time}]$$
where the subscript $s$ is to indicate explicitly that we are talking about "signal energy", and not real physical energy (which would be in units of Joules if you were to divide signal energy by some load impedance).

Similarly, the average power of a signal is defined by
$$P_{\textrm{s}}^\textrm{ av} = \lim_{T\to\infty}\frac{1}{T} \int^{+T/2}_{-T/2} |x(t)|^2\mathrm dt \hspace{1cm} \textrm{Units:}\hspace{0.3cm}[\textrm{signal}^2]$$

This makes sense because it is the same unit as the rate of signal energy transferred, which is signal power.

Therefore, the units of power spectral density should be [signal power per frequency band], or  $[\textrm{signal}^2 / \textrm{Hz}]$.

My problem is that I have seen many times now people who seem to know what they are talking about saying that the power spectral density is given by

$$ S_{xx}(f) = |X(f)|^2 $$

where $X(f)$ is the Fourier transform of $x(t)$. BUT, the units of this quantity are not correct. Since the units of the Fourier transform $X(f)$ are $[\textrm{signal}\cdot \textrm{time}]$, then the units of $S_{xx}(f)$ written above are $[\textrm{signal}^2\cdot \textrm{time}^2] = [\textrm{signal}^2\cdot \textrm{time} /\textrm{Hz}]$, which are the units of energy spectral density, not power spectral density. Am I missing something fundamental here? Why do people often write this simple definition of $S_{xx}(f)$?

See these answers for some examples:

Dilip Sarwate's answer to Difference between power spectral density, spectral power and power ratios
Florian's answer to Power spectral density: Why are these two methods equal?
Hilmar's answer to Help with obatining power spectral density of a simple continuous cosine (using both forms of the definition for PSD)


texts: Is This Interpretation of Auxiliary Independent Vector Analysis (AuxIVA) Correct?

texts:
I am implementing auxiliary function based Independent Vector Analysis (AuxIVA) from  Nobutaka Ono's original paper Stable and fast update rules for independent vector analysis based on auxiliary function technique. AuxIVA is also presented in other freely available papers, for example this one. It is an extension of plain Independent Vector Analysis where an auxiliary function of the original cost function is minimized.

There are four equations that make up the update rules of AuxIVA:

$$ r_k = \sqrt{\sum_{\omega=1}^{N_\omega} {\lvert w_k^h(\omega)x(\omega)\rvert}^2} $$
$$ V_k(\omega) = {1\over{N_t}}\sum_{t=1}^{N_t}{{G'(r_k) \over r_k} x(\omega) x^h(\omega) } $$
$$ w_k(\omega) = (W(\omega)V_k(\omega))^{-1}e_k$$
$$ w_k(\omega) = {w_k(\omega) \over {\sqrt {w_k^h(\omega)V_k(\omega)w_k(\omega)}}} $$

where

$ N_s $ is the number of sources.

$ k = 1,2,...,N_s$ is the source index.

$ e_k = [0,0,...0,1,0...]^T $, is a column vector with its only non-zero entry being a 1 at the k-th index.

$ G'(r_k)$ is the first derivative of the AuxIVA contrast function and since I'm using $G(r) = r$, $ G'(r_k) = 1$.

$ N_w $ is the number of frequency bins and $ N_t $ is the number of time bins in the STFT of the mixture.

The input I am using is structured like this:

$X$ is a tensor $N_s  * N_t * N_\omega $ which is the short-time Fourier transform (STFT) of $N_s$ mixtures.
$W$ is the mixing tensor that will be estimated by repeatedly applying the 4 update rules. Its dimensions are $N_s*N_s*N_\omega$

In Matlab notation, $w^h_k(\omega) = W[k,:,\omega] $ and $x(\omega)=X[:,:,\omega]$.

When I evaluate $r_k$ using the first equation , I get a vector of size $ 1 * N_t $.

To evaluate $V_k(\omega)$ using the second equation, I evaluate $ {G'(r_k) \over r_k}$, which is just $r_k$ because of the assumption $G(r_k) = r_k$. I then do point-wise multiplication between $ {G'(r_k) \over r_k} $ and $x(\omega)$ then post-multiply this product by $x^h(\omega)$. Because $x(\omega)$ has size $N_s*N_t$ and $ {G'(r_k) \over r_k} $, the point-wise multiplication between them a weighted copy of $x(\omega)$. When this weighted copy is post-multiplied by $x^h(\omega)$, a weighted covariance matrix of size $N_s*N_s$ is generated.

In the third equation I post-multiply $W(\omega)$, that has size $N_s*N_s$, by $V_k(\omega)$ from the previous equation, that has size $N_s*N_s$. I then invert this matrix to get $(W(\omega)V_k(\omega))^{-1}$ and post-multiply this by $e_k$ to get $w_k(\omega)$ that is a vector of size $1*N_s$

Finally, in the last equation, I evaluate ${\sqrt {w_k^h(\omega)V_k(\omega)w_k}}$, that is a scalar, and divide the vector $w_k(\omega)$ by this scalar to get a scaled version of $w_k(\omega)$.

I'd like to know if my interpretation of the four equations is correct. I do not have an in-depth understanding of the derivation of these equations so I'm relying on little information present in these papers to interpret and implement the algorithm.


texts:
Is there any plausible method to estimate or predict one signal, on the basis of known value of another signal, provided the two signals bear a strong correlation?

For instance, the audio amplitude and the moving pixels in a video, where the objects responsible for sound are in motion, are correlated usually. So, can the correlation between the two be exploited in any manner to predict the audio amplitude, if it goes missing, from the moving pixels?


texts: We know that OFDM eliminates the inter-block intereference. But there are still multipath interference in a single OFDM block(symbol). How does LTE handle this intra-block interference induced by multipath components so as to successfully demod. the signal ?


texts: Amplitude loss during resampling with IIR

texts:
I have a problem in that I am resampling a signal and loosing amplitude. The steps I do are the following, in c++:

Upsample/interpolate signal by 16x by padding with zeros.
Run an IIR Bessel 2nd order low pass filter with cutoff frequency of downsampler.
Downsample/decimate the signal by 13x (I take every 208th data point to achieve this).

The problem I am having is that I get a large amplitude loss after running the Bessel filter and lots of ringing. If I change the cutoff frequency of the filter to match the new sampling rate of the upsampler then I get a clean signal, as I wanted, but I still get the large loss in amplitude. I am loosing around 13x to 23x in intensity. I figure the zero padding is reducing the signal a lot. I'm really stuck on this and haven't done this type of processing before so any help is appreciated.


texts: biquad decomposition from given magnitude response

texts:
I have a adaptive FIR filter of length 84 with magnitude response , which is close to low pass. (Please see the attached figure). I need to design filter that has a magnitude response opposite of the FIR filter(to undo its effect),as set of upto 5 buquads. If i directly design the FIR using second order sections, there will be more than 5 biquad sections. I have following approach in mind:

Smooth the magnitude response of FIR filter( Don't need the exact ripple behavior)
 Inverse FFT the magnitude response and try to form cascaded sos from it ( e.g using tf2sos in Matlab)

I have following questions

Is my approach outlined correct? any other suggestions?
How do I smooth the magnitude response? Probably a attack release kind of  filter just to track its envelope? or if i just use Welch kind of power spectral  density estimate and then take its square root, would that be correct?
How about decimating the spectrum after smoothing, and then converting back to time domain and splitting to cascaded sos?

Basically, what i need is a technique that allows creating variable number of cascaded sos from given Filter magnitude response.  Thanks


texts: Why do I see a frequency shift from center when transmitting a QPSK via USRP with GNU Radio?

texts: I am transmitting a QPSK signal via GRC and when I look at it on the spectrum analyzer, the signal is shifted away from my center frequency. This shift increases the higher the center frequency (i.e. 1 MHz = almost no shift, 10 MHz = 1kHz shift, 50 kHz = 2.3kHz shift, 900 MHz = 43.5 kHz shift). Why does this shift occur? I have attached my flowgraph screenshot below.


texts: Why the following discrete type system,variable accumulator, is time invariant?

texts:
$y[n]=T{x[n]}=\displaystyle\sum_{k=n-n_{0}}^{n+n_{0}} x[k]$

it is some sort of moving summer which computes $n^{\text{th}}$ output sample by adding all samples lying within length $n_{0}$ around some point $n$ on $k$ -axis (where k is dummy variable) so even if we shift input by amount $n_{0}$ the length of interval of summation remain unchanged which is same as if we're shifting output by $n_{0}$ from which it follows system is Time invariant but how do we prove it mathematically .

my work so far

shifting input by $n_{0}$ , i.e, $T{x[n-n_{0}]}=\displaystyle\sum_{k=n-n_{0}}^{n+n_{0}} x[k-n_{0}]$

now,  $k\to k+n_{0}$ then,

LHS$=\displaystyle\sum_{k=n-2n_{0}}^{n} x[k]\neq y[n-n_{0}]$

here i'm getting the answer Time variant. can anyone help ?


texts: Are there any real world applications for complex-valued signals or impulse responses?

texts:
I was just curious...
$$x[n] {\longrightarrow}  \boxed{h[n]} {\longrightarrow} y[n]$$
I've never seen a real world filter where the coefficient of $h[n]$ were complex, or where $x[n]$ was a complex sequence.
But, the DSP book always makes a big deal about conjugate symmetric sequences, which implies that either $x[n]$ or $h[n]$ is composed of complex numbers.
What would the real world use case be for the following three scenarios:

complex $x[n]$, real $h[n]$
real    $x[n]$, complex $h[n]$
complex $x[n]$, complex $h[n]$

Do complex numbers exist in real world implementations?


texts:
I have a dataset for the function $g(t) = \int_{0}^{\infty}f(t-\tau)h(\tau)d\tau$ I would like to deconvolve. My assumptions are

The signal $f(t) = 0$ before the start of observation, that is for $t < 0$
The filter I use is causal, meaning that $h(t) = 0$ for $t < 0$ (for example, an exponential distribution function)

I have read this post, checked the proposed solution, and it works. My problem is that my filter function has a reasonably long tail, and the sampling frequency is rather coarse. My signal does not manage to recede to zero during the time of observation, as given in all the toy examples. The scipy.signal.deconvolve function seems to only deconvolve the part of the original signal where the convolved signal and the filter function fully overlap.

For my purposes, this is too wasteful.

Is it possible to use scipy.signal.deconvolve or another tool to deconvolve the entire dataset, not just the fully-overlapping part. I understand that, potentially, deconvolving the signal at the very end of the tail has larger error than the one in the middle. An ideal solution would propose a value of the deconvolved function for the entire duration of observation, and also report the expected deconvolution error as function of time. Any advice is welcome

Edit

Here is the minimal code to reconstruct undesired behaviour. The signal deconvolved using scipy.signal.deconvolve is shorter than the recorded convolved signal. I believe that, under suitable assumptions, the convolved signal contains enough information to reconstruct the original signal over the entire duration of recording. Note that

The signal provided in the example below is an oversimplification of my actual signal. It is a continuously changing signal, which is recorded over a short period of time. It is never really zero
The real signal I have is not zero before the observation either, but not much action happens there. I believe it can be approximated by a constant baseline, effects of which can be subtracted from the period of interest. This carries an intrinsic error, of course, and I'll try to estimate it at some point, but that is a topic for another question. For now, I would assume that the signal value before the start of observation is zero in order to isolate the main problem of this question

import numpy as np
import matplotlib.pyplot as plt
import scipy.signal

def exp_ker(t, tau):
    return np.exp(-t/tau)/tau

# Problem size
T_SIGNAL = 10
T_KERNEL = T_SIGNAL / 2

DT = 0.01
t_signal = np.arange(0, T_SIGNAL + DT, DT)
t_kernel = np.arange(0, T_KERNEL + DT, DT)
t_conv_full = np.arange(0, T_SIGNAL + T_KERNEL + DT, DT)
t_deconv_scipy = np.arange(0, T_SIGNAL - T_KERNEL + DT, DT)
NPOINT = len(t_signal)

# Box Signal
signal = np.zeros(NPOINT)
signal[np.sin(t_signal - 1.5)**2 > 0.5] = 1

# Kernel
TAU = 1.0
kernel = exp_ker(t_kernel, TAU)
kernel /= np.sum(kernel)

# Convolve
sig_conv_full = scipy.signal.convolve(signal, kernel, mode='full')
sig_conv_real = sig_conv_full[:NPOINT]

# Deconvolve
sig_deconv_full, sig_rem_full = scipy.signal.deconvolve(sig_conv_full, kernel)
sig_deconv_real, sig_rem_real = scipy.signal.deconvolve(sig_conv_real, kernel)

fig, ax = plt.subplots(nrows=2, ncols=3, figsize = (11,7), tight_layout=True)
ax[0][0].plot(t_signal, signal)
ax[1][0].plot(t_kernel, kernel)
ax[0][1].plot(t_conv_full, sig_conv_full)
ax[1][1].plot(t_signal, sig_conv_real)
ax[0][2].plot(t_signal, sig_deconv_full)
ax[1][2].plot(t_deconv_scipy, sig_deconv_real)

ax[0][0].set_title("Original signal")
ax[1][0].set_title("Filter")
ax[0][1].set_title("Full convolution")
ax[1][1].set_title("Realistic measured convolution")
ax[0][2].set_title("Deconvolution from full")
ax[1][2].set_title("Deconvolution from realistic")

ax[0][0].set_xlim([0, T_SIGNAL+T_KERNEL])
ax[1][0].set_xlim([0, T_SIGNAL+T_KERNEL])
ax[0][1].set_xlim([0, T_SIGNAL+T_KERNEL])
ax[1][1].set_xlim([0, T_SIGNAL+T_KERNEL])
ax[0][2].set_xlim([0, T_SIGNAL+T_KERNEL])
ax[1][2].set_xlim([0, T_SIGNAL+T_KERNEL])

plt.show()


texts: Why do we need to increase sampling frequency at the transmitter?

texts:
I've thinking about this for some time now and I was wondering why do we need to increase smapling rate in the transmitter? I will explain a bit more.

From the point of view of a software-defined radio, you convert bits to symbols (let's suppose I'm doing QPSK) and after pulse shaping with 4 samples per symbol, (which I know it also increase sampling frequency by 4 since it's another interpolation after all) I've seen it's quite common to do some multi-stage interpolation (or a single-stage interpolation, it doesn't matter) to increase the sampling frequency even more. Why is this beneficial? I mean, I can only think of one reason and that'd be because you have more samples per symbol, but if after you're upconverting to passband and send it to the channel, what was that for?

Then, when you get the signal at the receiver, you decimate it to decrease sampling frequency. This one, I think I understand it better, after doing synchronization (for example in symbol sync you might need more than 1 sample per symbol), you want to decrease the sampling frequency so you don't have to deal with so many samples and is less computational costly.

So my question is, why doing interpolation in the transmitter?

Correct me if I said something wrong, please. Thank you.


texts:
I reconstruct images from MRI k-space using ifft and root-sum-of-squares method.

imRef = ifftshift(ifftshift(ifft(ifft( ifftshift(ifftshift( kspacedata,1),2),[],1),[],2),1),2);
imSOS    = squeeze(sqrt(sum( abs(angle(imRef)).^2, 3)));
imagesc(abs(imSOS))

k = abs(imSOS);
disp(class(k)); %double

Class of image matrix k is shown as double.

Is the image matrix k an indexed image or intensity image?

The sample values from reconstructed image k is shown below.

4.2753    4.9807    4.5435    5.6548    6.1303    5.0229
3.3805    4.6260    5.1594    5.2692    4.1187    4.4885
5.8990    5.5275    4.3493    5.6182    6.7237    4.3071
6.4885    4.6861    4.4086    3.5034    5.2378    4.7466
6.1099    4.6995    4.1673    4.7408    3.8915    5.7531
5.4006    3.1289    5.6541    5.8782    4.6568    3.8166

By referrring http://in.mathworks.com/help/matlab/creating_plots/image-types.html,
I learned that for indexed images, the data matrix is represented by integers which are indices to color map. And if it were intensity images, I feel the data range is somewhere between 0 and 1. If k represents an indexed image, how can I know the colormap associated with it?

Thanks.


texts: Meaning of negative frequencies in Baseband non sinusoidal, non periodic signal

texts:
I can understand the meaning of negative frequencies in a sine or cosine signal, since by using Euler's identities, you have two complex phasors moving to different directions, which when added, give a real (cosine or sine) signal.
However if I have a random baseband (real, not periodic) signal, what does it mean for it to have negative frequencies?


texts:
a full scale signal of bandwidth 5 khz is sampled by an 10-bit ADC at a sampling rate of 2 Msa/sec

calculate the Signal to Quantization noise of the resulting DT signal
repeat for a 14-bit ADC at sampling rate 10000 sa/sec

I mean that S/N = 6.02 x b , so what is the effect if sampling rate on it


texts:
I am wondering the detail of the filtered backprojection.

Suppose I have a projection file:

$p(s,\theta)$=[1 2 3 1 2]

Then to get its filtered backprojection version using ramp filter, I should

apply FFT to it, to get its Fourier version $P(\omega,\theta)$
To use |$\omega$| to multiply $P(\omega,\theta)$
Backprojection

I am a little confused at second step here.

Using the numeric example above, to apply FFT to [1 2 3 1 2], we will get a complex sequence

   9.0000 + 0.0000i
  -1.0000 - 1.1756i
  -1.0000 + 1.9021i
  -1.0000 - 1.9021i
  -1.0000 + 1.1756i

Should I apply |$\omega$| to both real and complex part  of the sequence above, then do inverse FFT? Or should I only take the magnitude of above sequence, apply |$\omega$| to the magnitude, then do inverse FFT?

Either way, it seems I will get a complex sequence as the final results, but shouldn't the filtered projection be a real sequence? Anyone give me some pointers here? Thanks


texts: Given a Vertical Derivative Kernel, Find the output image after K is applied to the above input image

texts: Im not sure how to solve this, if someone can please help me a bit id appreciate it. I have to solve this by hand. (I know how to solve using matlab).


texts:
I am new to signal processing and especially to FFT. I need to know:

if it's possible to calculate FFT for example for vector $$V=\begin{bmatrix}1&2&3&4&5&6&7&8\end{bmatrix}$$ without calculate imaginary part
and will it be reversible ?


texts: Why do linear phase filters have symmetric impulse responses?

texts: It was given as a fact that linear phase filters have symmetric impulse responses, but I don't see why that has to be true. Can somebody please explain or prove this?


texts: In a typical Digital cable environment in the US, the spectrum is divided into 6MHz bands. When a tuner locks to a signal at say 800MHz, I would assume that the band for that signal is 797 - 803 MHz. The signal is QAM modulated. I would like to know why is that 6 MHz band required? If I can lock to a signal at 800MHz wont that be sufficient to reconstruct the original transmitted signal? From what I remember of my dsp course a few years back, I know that we need the band, but can't for the life of me remember why. Pointers to the theory will be appreciated


texts: Is there a procedure to build RLL code with arbitrary signature?

texts:
I am wondering if there is a procedure to build a generic $RLL(x, y)$ encoding.
This article seems to describe one, but I have compared it to the wiki page, and they do not seem to agree.
Has anyone done something like that before? If I am missing something, please let me know.


texts: Is it possible to weight the high frequency components of a signal to give high frequecy components greater overall power in the total signal?

texts: I have a multivariate time-series dataset, and would like to run PCA on my dataset to reduce the number of variables I input into a time-series model. I am concerned that running PCA may end up biasing my data towards low-frequency signal interactions given that most of the power in my signals lies in the lower frequency end (0-10 Hz). To get around this issue, I am wondering if it is possible to somehow weight the high frequency time-points of the signal to give them greater overall power, and reduce the likelihood that high-frequency signal interactions are washed out of my dataset after running PCA and retaining only a handful of principle components. Is there any way to do this reliably, or will I end up completely distorting the statistical properties of my original signal?


texts: How would I calculate the DC Gain for a Chebyshev Type 2 filter?

texts:
I'm currently working on an implementation of a Chebyshev Type 2 filter but the gain is all over the place when playing around with the order and ripple. I haven't found anything online but (as far as I understand) I need to calculate the DC gain to compensate for gain differences. How would I go about doing that?

I've tried to do s = 0 for my analog prototype which leaves me with just the coefficients b1 / a2 for every biquad. I multiplied all the fractions of the individual biquads together but the result did not help at all, it seems just as random as the gain itself.

Can anyone point me in the right direction?


texts:
i'm studying the practical utility of Fourier transforms and i have some questions. I hope to receive answers in layman terms.

1) Does the DTFT take only infinite input sequences?

2) If i apply the FT to a step function i get an infinite band spectrum. If i sample the step function and apply a DTFT does i get replicas of that infinite spectrum (obtained from FT) in the DTFT spectrum ?


texts: Short Time Discrete Fourier Transform to detect time dependent changes in a frequency of interest & Filter

texts:
I am working in matlab to compute the fourier relative phase of two signals as per https://sci-hub.tw/10.1123/jab.2017-0250

I have identified the fundamental frequency ($f_1$) for the signals (1.7 Hz) and now the instruction is to "Apply a short-time discrete fourier transform to each window to determine the fourier phase angles of $f_1$ at each time sample. The short time discrete fourier transform can be used to detect time-dependent changes for the frequency of interest and act to filter out potential higher harmonics.

I must run the SDFT for all windows, obtain the phase angles from each window and then transform the phase angles into a continuous time series.

I have read all of the STFT documentation on MATLAB but I can't seem to figure this part out.

Any help is greatly greatly appreciated!


texts: How is this was derived? DTFT for symmetric pulse

texts:
do not understand how the middle expression was derived from above expression,

after all summation\multiplication i get:

$$\frac{e^{-jwN} + e^{jwN} - e^{-jw(N+1)} + e^{jw(N+1)}}{2 - e^{-jw} - e^{jw}}$$


texts: Why bit rate is same in a lower frequency spectrum and higher spectrum?

texts: If there is a spectrum between 0 Mhz - 1 Mhz, bandwidth would be 1 Mhz here and for example with baseband we can send 2000 bps. What I can't understand is if spectrum is 5-6 Mhz instead of 0 - 1 Mhz, although the spectrum is the same 1 Mhz, shouldn't we be able to send more data because we're sending it with much higher frequencies? Why is bit rate fixated on spectrum instead frequencies itself? What am I missing here?


texts: Speech Processing applications: stereo data for features

texts:
I am working on speech databases that have a stereo format. I want to extract spectral information (Mel-filterbanks, MFCC, LPCC) and also some other prosody features like the fundamental Frequency F0.

Is there a standard way to handle the computations of speech features for Stereo data?

This is for speech recognition but also spotting some irregular speech audio events, so it is different from MIR.

The maximum amplitude difference between the two channels is 7% and the mean is 0.3%. Does not tell much about the spectral features, will investigate the difference in the frequency domain now.


texts:
I'm about to tackle implementing a Viterbi equalizer fo a GSM system in gnuradio.
I went through the internet and ieeexplore and I think that this document explains it best:

  Application of Viterbi Equalizer in GSM
  System

My question concerns the Matched Filter in the block diagram.
Normal Burst in GSM has 8 possible midambles. First of all, the Matched Filter block should determine which midable has been transmited. Midambles have highly-peaked auto-correlation function, so the first thing to do is to compute the modulated version of the 8 midambles and then convolve each of them with the received midamble and the one with the most peak-like is the most likely to have been sent. Once I have that done, it's easy to compute the channel response estimate.

I don't have much background in DSP and I was hoping someone could let me know if I understand it correctly.


texts: How to decide what subcarrier allocation should I use in OFDM?

texts:
For those familiar with the liquid-dsp library, or with OFDM in general, I am hesitating what subcarrier allocation should I use in a particular wireless system.

By subcarrier allocation I am refering to how many null subcarriers, pilot subcarriers and data subcarriers should I use, and in what order. Let's say that the total number of subcarriers is forced to be 64, due to channel bandwidth limitations.

How is this related to the perfomance of the system?

The liquid-dsp library provides a default subcarrier allocation, but I would like to use an allocation tailored to my system's requirements. I am interested in making my system more robust to Doppler effect (and thus to frequency shifting).

Is it right to assume that more null subcarriers or more pilot subcarriers will improve the OFDM performance under Doppler effect?


texts:
I am new to signal processing and and having difficulty understanding how to implement an IIR filter.  The reference is athttp://www.dxatlas.com/rocky/Advanced.asp in the Band scope section.  It concerns applying an IIR filter to a power spectrum with this equation:

FilteredSpectrum[i] = FilteredSpectrum[i]*(1-gain) + NewSpectrum[i] * gain

I understand that this is a classic 1st order IIR filter but to implement this, are you working data point by data point or are you using one complete spectra and then waiting for the next one (NewSpectrum) and calculating a whole new spectrum from the existing one and the new one that just came in?
I tried it this way, waiting to obtain the data for a whole spectrum, then waiting for the next one to come in and then doing the calculation. I then plot the resulting spectrum.  This then becomes the FilteredSpectrum while I wait for the next NewSpectrum.
Is this being done in the correct way?  I programmed this but saw no effect on the noise in the spectrum contrary to the article.
Can anyone tell me where I am going wrong?
Thanks


texts: Constant modulus algorithm - performance poor?

texts:
The question is based on a research article titled, "Novel Robust Blind Equalizer for QAM Signals
Using Iterative Weighted-Least-Mean-Square
Algorithm"

The Authors have proposed an equalization scheme for channel equalization for QAM symbols. The Authors in the last page, Table I present their results. The first column result is for Constant Modulus lagorithm given below:

5 (dB) 6.36 ; 10 (dB) 9.90 ;15 (dB) 15.12; 25 (dB) 18.0

with the plot

The Authors say that the values are in dB, but I don't undertstand why the SIR curve is increasing. In general, lesser the value of SIR, better is the perofrmance. But the curve shows the opposite. So, does CMA not work for QAM?

Moreover, their proposed method the values for which are also higher for high SNR. So, when the noise level is low both CMA and their method is perfroming badly?


texts: Separation of sinusoidal oscillations from the frequency spectrum

texts:
It is necessary to extract the harmonic signal from the audio spectrum.
That is, from the spectrum of 20 ... 20,000 Hz it is necessary to select only a signal with a frequency of 1,000 Hz, and suppress the rest.
You need to do this on a microcontroller.
As I understand it, you need to take the Fourier transform from the audio signal and multiply the result by a certain window function.
Maybe you can just estimate the frequency of zero crossing? Can it be easier to convolve a signal with some other signal?
The resources of the microcontroller are quite limited, in fact, I do not need the entire spectrum, I need one harmonic component of it. And do all this in real time ...


texts: Signal segmentation into states ( Stop/mov)

texts:
My question concerns signal segmentation.
My signal is the green one, which represents the distance from the first point to the rest of points.
I would like to cut the  trajectory into segments that each represents  the current status of the person, is he currently making a move, or making a stop?
This is my plot:

the green line is the distance measures smoothed using savitzky golay.
The second line in red represents the results I would like to have, when its =1 its a move, and when it is equal to 0 it is a stop in reality.As you can see, it is somehow easy to segment the trajectory using the trends, when it is increasing or decreasing, we should have a move. When it is constant, we should have a stop.

My question is, what are the methods that I can use and that can segment a signal using the trend change ?
Thank you


texts: solution on the time domain becomes “periodic” after the inverse fourier transform

texts:
I was trying to solve european option pricing problem using Conv method (introduced by Lord in 2008 https://pdfs.semanticscholar.org/0632/460bd50b2151f74ac40028df4cc60e73a884.pdf).

The final step of this algorithm is to transform the solution on the frequency domain to the time domain by inverse fast Fourier transform, which means that I can retrieve approximations for all the grid points.

However, I noticed that only the solutions in the center of the time domain (in this case, x=40, and I used log grid points) are accurate. Here is the plot: the orange line represents the approximation using FFT, the blue line represents the real solution.

Moreover, the approximation looks periodic. So I was wondering what kind of situation will inverse FFT give a 'periodic-like' solution? I did some research on this topic, and foundthat DFT assumes the input is periodic, which may cause  "time domain aliasing" (https://www.dspguide.com/ch10/3.htm).

I also found that "spectral leakage" may be related to my problem. Can anyone give me some advice on this? Thank you very much.

P.S. By periodic, I mean the solutions on the two ends are very close to each other. I changed lots of parameters, and this always holds.


texts:
I am trying to evaluate the symmetry of an image with Matlab. My approach is far is based on:

convert image to BW
get 2D gaussian from the BW pixel cloud
get center and axis
rotate to get horizontal and vertical axis
mirror from center to the right
compare (left side) with (mirrored right side) using MSE

The results are usually ok but I think that maybe this could be improved for shapes with unusual contours.

Any alternative or suggestion for improvement?


texts:
I have a small input signal of 60Hz sine wave from signal generator, which is corrupted with 50Hz mains supply frequency. I want to measure the amplitude of the 60Hz signal using FFT because it is very small to see in the oscilloscope.
The Matlab FFT code:

y = data;
Fs = 2048;
[r, L] = size(y);
NFFT = 2^nextpow2(L); % Next power of 2 from length of y
Y = fft(y,NFFT)/L;
f = Fs/2*linspace(0,1,NFFT/2+1);
% Plot single-sided amplitude spectrum.
plot(f,2*abs(Y(1:NFFT/2+1)))

But the FFT plot doesn't give a sharp peak at 50 and 60Hz. The plot looks like this: . The consecutive points have high and low amplitude alternatively which gives a saw-tooth like plot. Why is it so? Is the amplitude of 60Hz affected by this?


texts:
Can anyone give some tips how to obtain Skeleton from distance map?

I already managed to obtain skeleton using erased method (e.g. zhang suen) but it's time consuming because it's an iterative method (the thicker the object the longer it takes).

OpenCV has well optimized distance transform function than can be calculated in O(n) time. Is there any paper or even better code sample that achieves that (ideally quite fast)?


texts: Determining what filter (if any) has been applied to an image

texts:
I'm trying to determine what "filter" has been applied to an image.  I have the original, raw image and the processed image.  The processed image has been put through a pipeline (black box) that does various things to the image in an iterative manner.

The filter, as far as I can tell, is similar to an unsharp-mask, but with "negative bowls" mitigated.  However, the processed image cannot be reproduced by a simple unsharp mask.

I've attempted to measure the "filter function" by taking the ratio of the power spectra of the raw and unprocessed images, but the best I've been able to do with that is unsharp mask with a non-gaussian smoothing function.

What methods are available for determining the filter applied to an image?

(not related to Determining the type of filter on an image)


texts: I have two sine signals A and B which are simultaneously sampled at 2500 Hz using ADC. Through oscilloscope, I find that signal B lags A by about 5 degrees. I would like to digitally lead signal B to sync it with A. How to do that in MCU?


texts: Appropriate sampling frequency for bpsk modulated signal

texts: I'm modulating a message with particular baudrate, say 2MHz using BPSK , Carrier frequency(Fc) is 8MHz, What should be appropriate Sampling Frequency(Fs) following Nyquist criteria, Should it be greater than 2*(2*baudrate) or 2*(Fc+baudrate)?


texts: Will decorrelating an audio signal help reduce interference patterns at low frequencies?

texts:
In live sound it is common to have a left/right sub-speaker configuration, which will produce an strong interference pattern in the audience area based on listener/sub-speaker locations.

If the left/right sub-speakers were decorrelated (phase randomization?) would this help reduce the interference pattern in the audience area? Would the effect be minimal or significant at low frequencies?


texts: Are there any analytic approaches to the design of quadratic polynomial filters?

texts:
The following paper describes an application of the Teager-Kaiser energy operator to x-ray image enhancement:

  Reinhard Bernstein, Michael S. Moore and Sanjit K. Mitra, "Adjustable
  Quadratic Filters for Image Enhancement" Proc. IEEE International
  Conference on Image Processing (ICIP), Santa Barbara, CA, vol. 1, pp.
  287-290, Oct. 1997. http://vision.ece.ucsb.edu/publications/view_abstract.cgi?52

The authors develop intuition for the behavior of the filter through analogy with a similar linear operator (i.e. "Thus the output of a Teager filter is approximately equal to a highpass filter response weighted by the local mean."). For the sake of precision, by quadratic polynomial filters, I mean non-linear, non-recursive filters that can be completely characterized by a truncated Volterra Series, as follows (for the 1D case):

$$
y(n) = \sum_{m_1=0}^{N_1-1}{ h_1(m_1)x(n - m_1) } + \sum_{m_1=0}^{N_2-1}{\hphantom{.}\sum_{m_2=0}^{N_2-1}{ h_2(m_1,m_2)x(n - m_1)x(n - m_2) } }
$$

It seems that most approaches to the design of low-order polynomial filters involve system identification frameworks, but without any deep understanding as to why the estimated filters work.  Are analytic approaches based on linear analogies currently the state-of-the-art, or are there any known mathematical tools that can be used?


texts: Detecting a curve with certain characteristics in a spectrogram

texts:
I have a spectrogram built by breaking a signal into chunks and taking the FFT of these chunks. An example spectrogram is:

In this spectrogram I am looking for a curve (aka pitch contour) that:

Starts at zero
Increases to an unknown value
Stays at that unknown value for at least one minute
Decreases back to zero

It's fairly easy to program this curve detection in the spectrogram above since the curve of interest is brighter than other potential curves.  However, this brightness difference won't exist in a noisier data set.

How can I use the constraints I know about the curve (starts at zero, increases, ...) to reliably find the curve without relying on the brightness?


texts: Determining power spectral density from a sample

texts:
To start, I have absolutely no background in electrical engineering, I am a computer scientist by trade.

I'm currently working on a project where I am attempting to code a function that uses the power spectrum density of a particular signal at a given frequency.

Specifically, I want to calculate the following function

$$F(x,f) = \int [P(f) * X(x,f)] df$$

where $F$ is the function I want to calculate, $f$ is the frequency, $X$ is an  function that doesn't pertain to my question, $x$ is a variable that also doesn't pertain to the question, and $P$ is the power spectral density of a signal.

I don't have a function describing the signal, instead I have a vector of samples of the signal.  What I'm interested in calculating is $P$ using my sample vector where $P$ has been normalized such that

$$ \int [P(f)] df = 1$$

Questions:

How might I go about this in MATLAB?  I have looked at the pwelch function (Welch's power spectrum density estimate) and I think it does what I want.  However, the values seem to be scaled to $[0,\pi]$ which makes me a bit wary.  In addition, just calling the function will not scale the values so that $ \int [P(f)] df = 1$.  Is using pwelch an acceptable approach for what I'm trying to do and how can I get things scaled correctly?
In addition to Computer Science, I also have a background in math.  However, I'm a bit thrown off by the integrals that I have been provided since the result has been "evaluated" despite no upper and lower limits ($F$ should evaluate to an actual value).  Is it common notation to integrate from negative to positive infinity in signal processing using this notation?  I understand that this question is a bit vague since I haven't really explained much of what I am trying to do.  This question is meant more as a general notation question regarding convention in the signal processing / electrical engineering community.  Specifically, is there a common convention as to what limits to integrate over when the limits have been omitted?


texts: Improve NMF for data with partial overlaps in multiple groups?

texts:
I want to use NMF to separate true sources from data. My data is in group structure with overlap elements. For example (in the smaller version)

group1: contains A,B,C,D,E,F,G patterns
group2: contains B,C,G,H,I,J patterns
group3: contains B,K,L patterns

In the data, A,B,C,D are detected, and group A should be the result as true source. I try using l1-norm as a penalty term for group-sparsity but the result does not look nice yet. I think the problem is l1 may not be enough to restrain since B appears in every groups. Plus, E,F,G in group A are allowed to be missing.

What can I do to make my NMF better in this particular situation? In fact, each group has about 20-400 patterns and overlap can be about 10%


texts: What are some efficient algorithms for real-time calculation of eigenvalues?

texts:
I need to calculate eigenvalues of a square matrix for a real-time implementation using microcontrollers or dSPACE. Obviously, I can find the eigenvalues of a 2by2 matrix analytically. I am wondering if there are any efficient numerical methods/algorithms for calculating eigenvalues of square matrices of dimension greater than 2?

Any help, including introducing a paper, is appreciated.


texts: I'm looking for a way to visually inspect the amplitude of frequency components in a 3D image that I have taken the fftn of in matlab. Does anyone have any idea how to go about this?


texts: Finding point height on a cup using OpenCV

texts:
Suppose that I want to find the 3D position of a cup with its rotation, with image input like this (this cup can be rotated to point in any direction):

Given that I have a bunch of 2D points specifying the top circle and bottom circle like the following image. (Let's assume that these points are given by a person drawing the lines around the cup, so it won't be very accurate. Ellipse fitting or SolvePnP might be needed to recover a good approximation. And the bottom circle is not a complete circle, it's just part of a circle. Sometimes the top part will be occluded as well so we cannot rely that there will be a complete circle)

I also know the physical radius of the top and bottom circle, and the distance between them by using a ruler to measure them beforehand.

I want to find the complete 2 circle like following image (I think I need to find the position of the cup and its up direction before I could project the complete circles):

Let's say that my ultimate goal is to be able to find the closest 2D top point and closest 2D bottom point, given a 2D point on the side of the cup, like the following image:

A point can also be inside of the cup, like so:

Let's define distance(a, b) as a function that find euclidean distance from point a and point b in pixel units.

From that I would be able to calculate the distance(side point, bottom point) / distance(top point, bottom point) which will be a scale number from 0 to 1, if I multiply this number to the physical height of the cup measured by the ruler, then I will know how high the point is from the bottom of the cup in metric unit.

What is the method I can use to find the corresponding top and bottom point given point on the side, so that I can finally find out the height of the point from the bottom of the cup?

I'm thinking of using PnP to solve this but my points do not have correct IDs associated with them. And I don't want to know the exact rotation of the cup, I only want to know the up direction of the cup.
I also think that fitting the ellipse might help somewhat, but maybe it's not the best because the circle is not complete.
If you have any suggestions, please tell me how to obtain the point height from the bottom of the cup.


texts: Software Mixing of Multiple Audio Streams From Network

texts:
TLDR: How do I mix network streams when streams might be unreliable?
I am working on a project which will allow musicians to practice/perform together over the internet with low latency. (Think JackTrip but more user friendly).
I am receiving raw PCM audio data via UDP over the network. As these come in, I identify who the sender is and pipe that stream into that particular person's buffer. I have a separate buffer for each person participating.
Periodically I then take one "chunk" at a time from each buffer, mix them together and output to the speakers of the device.
The issue I'm having is knowing when to take that "chunk". Some clients go offline and their buffers run empty. I cannot just wait for their buffer to refill as this will slow down the other clients.
Thoughts I had were to look at all the buffers at a particular point in time and only process a chunk when at least half of the buffers are populated.
Any ideas?
Other details:

My buffers are 128 samples big.
I am using a sample rate of 44100
I am using 16 bit signed integer pcm
Streams are MONO
I am using PortAudio and C++.
I am using ASIO audio drivers.


texts: Why do people use STFT as a preprocessing step to using CNN?

texts:
Just briefly looking up some research papers on audio data and I have come across some papers that use STFT as a preprocessing step to using CNN. Why is this the case? What are the advantages and disadvantages of doing so?
Some research papers that use STFT;

https://arxiv.org/pdf/1712.02898.pdf
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6928168/


texts: How to segment frequency bands after FFT and calculate power?

texts:
I have been working with EEG signal. I have raw EEG data for a 2-second (i.e. $t=2$) duration. My objectives are:

Transforming these raw data from time domain to frequency domain.
Segmentation into two frequency bands: $\left[4 - 8\textrm{ Hz}\right]$ and $\left[9 - 13\textrm{ Hz}\right]$.
Calculating the average power of these two bands separately.

I am doing the signal analysis in MATLAB. Sampling frequency is $512\textrm{ Hz}$. I have set the frequency resolution to $0.5\textrm{ Hz}$. For the first objective, I have used the fft function to transform the data.

freq = fft(x);  // x is my eeg data

I'm not sure on how to proceed in the second objective but I did in the following way. Since the frequency resolution is $0.5\textrm{ Hz}$, the bin numbers ($9$ to $17$) represent $\left[4 - 8\textrm{ Hz}\right]$. So, I did

band1 = freq(9:17);

Finally, to calculate the average power of a band, I used bandpower function.

power = bandpower(band1);

Are the proceedings correct? If not, please help me. I am new to signal processing.


texts:
Bit of a long post, but this is a complex topic:

I want to hash of a series of video files so that they can be quickly checked for duplication. I know that any amount of data can be reduced to a hash, but I'd like to do this in a way that is:

Format independent, i.e. not a binary hash, but one based on what you see
Resolution independent - aspect ratio notwithstanding
Offset independent - this is the tricky part

So far this is what I've got:

I use handbrake to extract still images from a video stream - this makes an FLV come out the same as an MP4
I wrote some code that will blur (nearest neighbor) the image into a smaller one, e.g. 640x480 => 64x48. It then reduces the colors to a smaller palate. This eliminates minor differences in aspect ratio and small pixel differences due to different codecs/bitrates.
Some more code that will hash that image into a 128-bit byte array. These can be stored in a database and compared very efficiently

Where I'm really stuck is the offset. If video A and video B are the "same" video, but B is missing the first 2 seconds, or has additional minute/hour/etc. of footage, the whole thing is off; hashes either match or they don't. In fact, I might even have issues with my sampling rate in handbrake as I don't totally understand key-frames - I'm just taking X frames per second.

So what I'd like is some way to sample sections of the video, and store many hashes per video file, and if any hashes from A match any hashes from B, do further analysis.

I figure this must be possible because of the way SoundHound and Shazaam work on music. Does anyone have insight into this?


texts: How to represent the following system function in a block diagram?

texts:
I am aware that this a simple question, but I haven't been able to find a single reference that explains this situation. The system function is:

$$\frac{1}{1-(0.3)(1+j)D}$$

How can one draw a block diagram with only real components to represent something that is complex?

The system function is

$$\frac{Y}{x}  = \frac{1}{1-(0.3)(1+j)D} \implies Y(1-(0.3)(1+j)D)=X$$
where $Y$ is the output and $X$ is the input.

Therefore $$Y-DY(0.3)(1+j)=X \implies y[n]=0.3y[n-1](1+j)+x[n]$$


texts: Possible to shift image pixel-wise with FFT?

texts:
I know we can shift an image entirely with FFT as

https://stackoverflow.com/questions/25827916/matlab-shifting-an-image-using-fft

However, is it possible to shift the image pixel-wise? I just found a similar description in a recently published paper:
X. Wang, L. Li, and G. Hou, "High-resolution light field reconstruction using a hybrid imaging system," Appl. Opt.  55, 2580-2593 (2016).
They use a subband approach that really confused me.