texts: IQ signal FM descrimination using phase derivative

texts:
I'm trying to demodulate an FM signal recorded as IQ samples from RTL-SDR at 2.4Msps with RTL-SDR centered on an FM station's frequency.

So the input signal is 8 bit IQ baseband at 2.4MSps.

The data is available here.

The FFT of the input signal looks fine and matches what I see in SDR-Sharp so I think the data is good.

My understanding is that I should be able to discriminate the FM in Octave by:

Removing the DC offset
Low pass filtering it to 240KHz and decimating
Computing discrete derivative of the phase component

The FFT looks good after the low pass filtering and decimation.
My assumption is that applying a FIR low pass filter shouldn't distort phase (not sure if I'm correct)

I'm then computing discrete derivative of the phase of the signal by convoluting the phase signal with the discrete derivative's impulse response of [1,-1].

I'm expecting that the spectrum of the derivative signal would contain the composite FM signal with 0-15KHz occupied by the mono L+R component the 19KHz pilot tone and so on.
But I'm getting white noise in the FFT of the phase derivative (see below).

My Octave code is as follows

% 2.4MSps IQ baseband signal of an FM station from RTL-SDR recorded in SDR#
  samples = audioread("SDRSharp_20191229_133205Z_102102000Hz_IQ.wav", "native");
  csamples = arrayfun(@complex,samples(:,1),samples(:,2));

% 1) - remove DC offset
  csamples_ac = csamples - mean(csamples);

% 2) - low pass filter and decimate to get complex 240KSps (240KHz Widband FM)
  csamples_filtered = decimate(csamples_ac, 10, "fir");

% 3) - descrete derivative of phase
  filtered_derivative = conv(angle(csamples_filtered), [1,-1]);

  plot(abs(fftshift(fft(filtered_derivative, 32768))));
  axis("tight");

Edit: Thanks to hotpaw2 and Dan Boschen I now know what my mistakes were and have a working Octave script. The main mistake was not unwrapping the phase, also when discriminating by convolution with [1,-1] one needs to discard the first and last samples from the result because of possible artifacts of the convolution which give huge values at the ends of the sequence, the third mistake was not converting to int16 and not getting rid of DC in the sound samples before using Octave's audioplayer function.

In case anyone ever needs such a script a working version is below.
(Note that the phase-based discrimination suffers from a low-pass filtering 1/f rolloff effect, for more details see this answer)

pkg load signal;

#reading SDR Sharp recording (2.4Msps,RAW,8bit,baseband)
samples = audioread("SDRSharp_20191229_183956Z_99500000Hz_IQ.wav", "native");
#one channel real, other channel - imaginary components
unshifted_signal = double(samples(:,1)) .+ double(samples(:,2))*j;

#removing DC, this is important,
unshifted_signal = unshifted_signal - mean(unshifted_signal);

#a 1550 Hz frequency shift to move the real carrier center frequency as close to 0 as possible (de-trending the phase)
#the frequency shift is not absolutely necessary, small diviations don't affect the demodulation
#this would be station specific, selected to minimized the slope on plot(unwrp_phase)
freq_shift = exp(-j*1550*2*pi*[1:length(unshifted_signal)]/2400000)';
#freq_shift = 1;
signal = unshifted_signal.*freq_shift;

#low-pass filter and decimate down to 240KHz
rcv_240 = decimate(signal, 10);
#calculating the phase, and unwrapping it (unwrapping is important)
unwrp_phase = unwrap(angle(rcv_240));

#doing the actual demodulation (discrimination)
#not including the ends because of possible convolution artifacts
phase_drv = conv(unwrp_phase, [1,-1])(2:end-1);

#extract L+R submodulated at 0-15KHz by low-pass filtering and decimation
monoLplusR_unnormalized = decimate(phase_drv, 8);

#normalize the range for 16bits for audioplayer, it is important to have no DC here (removed earlier)
monoLplusR = int16(monoLplusR_unnormalized/max(abs(monoLplusR_unnormalized))*32766);

#play at 30Ksps (0-15KHz)
player = audioplayer(monoLplusR, 30000, 16);
play(player);


texts: Detect playback position in swept sine sweep

texts:
I am wondering what the most precise method is to detect the playback sample position of a sine sweep? The real playback sample position is unknown and an DSP with constraint computing capabilities shoud be used for the estimation, recording the playback by an external microphone.

In the concrete case the sine sweep is repeatedly played with fixed duration in the ultrasound range and a microphone 50 cm away from the loudspeaker is used to record the chirp and detect the playback position. After each single chirp playback might be a delay, whereby the delay time is known and doesn't change. Real-word noise is given in the background, which might be as loud as the ultrasound playback. One period of the sine sweep looks like this:

As visible, the frequency in the chirp is either linear or exponentially increasing from a low frequency to a high frequency, fade in and fade out is applied and the chirp duration is 100ms with 44kHz sampling rate.


texts: Why does the BER rate change randomly versus the SNR?

texts:
I have altered a MATLAB code that simulates the BPSK modulation using a raised cosine filter at the transmitter and  a matched filter at the receiver to study how the signal changes in each step. But, the final plot of the BER versus SNR is not decreasing as the SNR increases. I have no clue how to fix this. I would appreciate any help. The image and code is below

BER vs SNR

clear
N  = 10^6; % number of bits or symbols
T  = 1; % symbol duration of 1us
os = 5; % oversampling factor
fs = 5/T; % sampling frequency in MHz
rolloff = 0.05;

Eb_N0_dB = [0:10]; % multiple Eb/N0 values

for ii = 1:length(Eb_N0_dB)
    filter = rcosine(1/T,os,'sqrt',rolloff);
   % Transmitter
   ip = rand(1,N)>0.5; % generating 0,1 with equal probability
   s = 2*ip-1; % BPSK modulation 0 -> -1; 1 -> 1

   % up sampling the signal for transmission
   sU = [s;zeros(os-1,length(s))];
   sU = sU(:).';
   sFilt = 1/sqrt(os)*conv(sU,filter);
   sFilt = sFilt(1:N*os);

   % Noise addition
   y= awgn(sFilt,ii,0);

   % mathched filter
   yFilt = conv(y,fliplr(filter)); % convolution
   ySamp = yFilt(os:os:N*os);  % sampling at time T

   % receiver - hard decision decoding
   ipHat = real(ySamp)>0;

   % counting the errors
   nErr(ii) = size(find([ip- ipHat]),2);

end

simBer = nErr/N; % simulated ber
semilogy(Eb_N0_dB,simBer,'mx-');
grid on
xlabel('Eb/No, dB');
ylabel('Bit Error Rate');
title('Bit error probability curve for BPSK modulation');


texts: How many coefficient sections should I select when designing filters with MATLAB FDATOOL?

texts:
I attach a picture about the results of a filter design in Matlab.

It says that it has 12 sections. One section contains the coefficients of the transfer function. If I'm implementing this filter in a microcontroller, I think that 12 sections would take much time as for to do this inside an interrupt loop.

What happens if I only choose 3 sections? Would this affect badly the filter performance?


texts: Building a spectral envelop of FFT'd audio

texts:
I'm trying to figure out how to create a good spectral envelope of a signal.

Basically I am, at present, taking a windowed section of audio applying an FFT and generating a bar chart style representation of the magnitude of the spectrum.

However to add to this I'd really like to have a good spectral envelope overlaid over the top.  Unfortunately I just can't seem to come up with a good solution.

I tried a simple peak picking algorithm where I find every peak in the spectrum (I literally just look for points where the current value is greater than the values in the buckets either side).  This returns me a set of peaks and I then use a catmull-rom interpolation to draw the line over the peaks.

This follows the spectrum reasonably as you can see in the following screenshot:

However its not ideal.  In that image for example you can see how it doesn't follow the spectrum on the lefthand side.

When you zoom out:

You see that the envelope is pretty jaggy.  Its not terrible but is this really the best way to build a spectral envelope?

Is there a better way of picking the ideal peaks so that it truly envelopes the spectrum?  If so can anyone point me towards algorithms?

Also is catmull-rom interpolation the best way of doing it?  Can anyone suggest a better interpolation method and show me how to implement it?

The question is language agnostic but I'm writing in C++.

Edit: Ok I found an implementation of Auto-Regressive modelling.

I then implemented the method as follows:

    std::vector< float > coefficients( 3 );
    AutoRegression( &mSpecBuffer.front(), kFFTSizeDiv2, 3, &coefficients.front(), MAXENTROPY );

    mPeakBuffer.clear();

    mPeakBuffer.push_back( Peak( 0, mSpecBuffer[0] ) );
    mPeakBuffer.push_back( Peak( 1, mSpecBuffer[1] ) );
    mPeakBuffer.push_back( Peak( 2, mSpecBuffer[2] ) );

    int x       = 3;
    int xMax    = kFFTSizeDiv2;
    while( x < xMax )
    {
        const float k3  = (mPeakBuffer.end() - 3)->peakHeight;
        const float k2  = (mPeakBuffer.end() - 2)->peakHeight;
        const float k1  = (mPeakBuffer.end() - 1)->peakHeight;

        const float k   = (k1 * coefficients[0]) + (k2 * coefficients[1]) + (k3 * coefficients[2]);

        mPeakBuffer.push_back( Peak( x, k ) );
        x++;
    }

This gives me the following result:

Which to my eye looks a HELL of a lot better.

Zoomed right out it still looks pretty damned good:

So I just want to check, if this is correct?  If so I'll work along this path further :)


texts:
My professor asked me to convert following powers into decibels:
15W, 25W, 33W, 450mW, 24MW, 44 GW,120pW.
I know that decibels are about ratio power/reference_power.
I don't have reference power specified here. Is there something like default value? What should I do?


texts:
let us consider following graph of singular values

i want to make  some kind of  clustering of these data,namely to  seperate  main components from non main components,let say signal components from noise components,i would like to do like this(any software matlab,etc is great,better matlab)let us start like this  ,first do linear regression  with first point,then do regression analysis with first two point and so on,point is that  one want to  create two group,in first group   coefficients of  regression lines should be  close to each other, also in another group  regression coefficients should be close to each other,but regression  coefficients  in one group must be different then coefficients in another group,that means that we should find such point which separate this group optimally,  in other word i should stop regression analysis at some point which  well separate  two group,and another regression will start from this stop point till other rest points,please help me how to do it programaticaly


texts: Suggesting method for removing noise and image restoration?

texts:
Suppose that we have degraded an image with the following:

$$g(n_1,n_2) = f(n_1,n_2)^{v(n_1,n_2)}\text,$$

with $v(n_1,n_2)$ being random noise which is independent from image and we have these relations:

$$f(n_1,n_2) > 1 ,\quad v(n_1,n_2) > 0\text.$$

Suggest the method for removing noise with transforming $g$ and filter this image in the transformed domain.

My suggestion:

I think that I take natural logarithm from equation then I have:

$$\begin{align}
\ln(g(n_1,n_2)) &= \ln\left(f(n_1,n_2)^{v(n_1,n_2)}\right)\\
&= v(n_1,n_2)\ln(f(n_1,n_2))\\
\implies\\
\frac{\ln(g(n_1,n_2))}{v(n_1,n_2)} &= \ln\left(f(n_1,n_2)\right)\\
\implies\\
\mathbb{e}^{\frac{\ln(g(n_1,n_2))}{v(n_1,n_2)}} &= f(n_1,n_2)
\end{align}$$

But I don't have any idea how to estimate noise!


texts: Can we sample the signal with any period as long as the Nyquist rate is respected

texts:
I have a question regarding the sampling rate. Suppose that we transmitted a signal $m(t)$ then at receiver side, we received the continuous signal $x(t)$, which is time varying and sampled with a period of $T$ seconds at regular intervals of time.  It's multiplied by the sampling function $s(t)$ which is series of impulses, then the resultant signal $x(n)$ which is a discrete-time signal is given by:
$$x(n) = x(t)s(t)|_{t=nT}~~~,~~~ \text{for all }~~ n \in Z. $$

The continuous signal is as below:

The given signals output is shown in figure below:

The given signal output is shown in the Figure above
$$x(nT) = [10, 9, 8, 7, 6, 5, 4, 3, 2, 1] ~~~,~~~\text{for } ~~~n = 0,1,2,...,9$$

If we sampled the continuous signal $x(t)$ by sampling period of $T/2$ instead of $T$, so we supposed to have $20$ output samples, which are:
$$X(nT/2) = [10 , 9.5 , 9, 8.5, 8, 7.5, 7, 6.5, 6, 5.5, 5, 4.5, 4, 3.5, 3, 2.5
, 2, 1.5, 1, 0.5]$$
$$~~~~,~~~~ \text{for }~~ n= 0,1,2...,19 $$

so we have a signal output of $20$ samples, In case of we took two polyphase components of signal X(nT/2), with length of $10$ samples similar into the $X(nT)$, let's call these two components X1 and X2 ..
X1 = 10; 9; ...... 1
X2 = 9.5; 8.5 .....0.5

My question is, Do $X1$ and $X2$ are similar ? I mean Do they give the same performance if we demodulated X1 and X2 and continued with each one of them .. will they give, for example,  the same BER

OR .. when changing the period of sampling, we should change the filters parameter or something else ?

thank you


texts: Can the Cramér-Rao Lower Bound be constant?

texts:
In many text books and research papers, I have seen that for the plot of Cramér-Rao Lower Bound vs Signal to Noise Ratio, the CRLB decreases with increasing SNR.

Is it possible that the CRLB remains constant for all SNR?
If so, what is the implication?


texts: Difference between two Sine wave equations

texts:
I'm confused as what is the difference between these two sine wave equations

x(t) = Sin(2*pi*F*t)

and

x(t) = Sin(2*pi*F*nTs)

x(t) = Sin(2*pi*F*t) is supposed to be used with analog signal, here t is supposed to me the samples when speaking of matlab.

A = 4;       %Amplitude
Freq = 100;
Time = 1/Freq; %0.01
Fs = 1000;      %Sampling Frequency
Ts = 1/Fs;   %Sampling Rate
t = 0:Ts:(Time);
x=A*sin(2*pi*Freq*t);

The output,

Similarly if I use the stem command than a plot command I will get the sampled values instead.

If I'm getting the sampled result from the first equation than what is the purpose to replace t by nTs in the equation and using the second equation ?

I couldn't be able to demonstrate the difference and visualize it in Matlab. Kindly guide me.


texts: Measure the SNR of a signal in the frequency domain?

texts:
How do you measure the SNR of a sinewave in the frequency domain? (Assuming no filtering.)

Suppose: $$x(n) = s(n) + n(n)$$

Create the signal (nCycles of a sinewave) in MATLAB...:

sampleRate = 1024;
f0 = sampleRate/8;

nCycles = 11;
time = 0:1/sampleRate:nCycles/f0;

signal = sin(2*pi*f0*time);

Create the noise and scale it by the desired SNR...

SNR = 10;
noise = randn(size(signal));
% scale the noise to obtain the desired SNR
noise = noise / norm(noise) * norm(signal) / 10^(SNR/20);

x = signal + noise;

Calculate the resulting SNR (in the time domain):

actualSNR = 20*log10(norm(signal)/norm(x - signal));
disp(['SNR = ',num2str(actualSNR),'  dB'])

Plot the noisy signal in time and frequency

subplot(2,1,1)
% plot the signal in time
plot(time,signal)
hold on; grid on
plot(time,x,'r')

% plot the noisy signal in frequency
NFFT = 4096;
X = fftshift(fft(x,NFFT));
X = X/max(abs(X));
f = sampleRate/2*linspace(-1,1,NFFT);
subplot(2,1,2)

plot(f,20*log10(abs(X)))
grid on;


texts: Variable Step Size LMS vs Leaky LMS Adaptive Filter Algorithm

texts: What is the advantage of Variable step size LMS over Leaky-LMS adaptive filter algorithm? Which one has a better performance?


texts:
It might be a very silly question, however I'm facing problem with it. Now, the Gaussian noise is a signal with zero mean and variance. I understand what the mean and the variance mean however, I'm facing problem with zero mean. What does that mean? Does it mean that it is only a signal with variance which represents the magnitude of the signal? And if this is the case, why we bother ourself with variance since the magnitude of this signal is random?  I want to understand that because I want build a sensor (a function in C/C++) and add some noise to the data. In MatLab, there is randn to generate Gaussian noise, but I have no idea how to do same concept in C++.

Edit: Let's say I have a sensor with $\pm$ 0.2 as an error. What I understand that the noise should be a Gaussian noise with zero mean and variance. Now, I have a real data which represents the position in 1D. My sensor now should give the position with some uncertainty. This is my code in C++11

#include <iostream>
#include <chrono>
#include <random>

int main(int argc, const char * argv[])
{

    double noise; // Gaussian noise with zero mean and variance 1
    double data_sensor;
    double position(2.0);

    unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
    std::default_random_engine engine(seed);
    std::normal_distribution<double> dist(0, 1);

    for (int i(0); i < 10; ++i)
    {
        noise = dist(engine);
        data_sensor = position + 0.2*noise;
        std::cout << "Real Data: " << position << "  Sensor Data: " << data_sensor << std::endl;

    }
    return 0;
}

The output

Real Data: 2  Sensor Data: 2.19025
Real Data: 2  Sensor Data: 1.96754
Real Data: 2  Sensor Data: 2.03551
Real Data: 2  Sensor Data: 1.58706   << Why this out of the range
Real Data: 2  Sensor Data: 2.11237
Real Data: 2  Sensor Data: 1.98482
Real Data: 2  Sensor Data: 1.94809
Real Data: 2  Sensor Data: 1.8264
Real Data: 2  Sensor Data: 1.9776
Real Data: 2  Sensor Data: 1.70071   << Why this out of the range


texts: NRZ vs. Manchester pulse shaping filter (Modulator)

texts:
I'm trying to visualize the differences on the output waveform of a modulator when using NRZ or a Manchester pulse shaping filter. To keep it simple, let's think of a binary PAM signal with an input bit sequence 101011.

My thoughts are that with a Half Sine or a Raised Cosine pulse shaping filter, I will see the transitions between the 1's and 0's smooth out, but I'm struggling to think about the differences between the NRZ and the Manchester.


texts: Absolute convergence of periodic sinc interpolation

texts:
An $N$-periodic complex discrete-time sequence $[x_0, \dots, x_{N-1}]$ can be resampled to an $M$-periodic sequence $[y_0, \dots, y_{M-1}]$ with $M>N$, using sinc interpolation:

$$\begin{align}y_m &= \sum_{n=-\infty}^\infty \operatorname{sinc}\left(\frac{Nm}{M} - n\right)x_{n\operatorname{mod}N} \\&= \sum_{k=-\infty}^{\infty}\sum_{n=0}^{N-1}\operatorname{sinc}\left(\frac{Nm}{M} - n - Nk\right)x_n\end{align}\tag{1}$$

where $\operatorname{mod}$ denotes the modulo operation and:

$$\operatorname{sinc}(x) = \begin{cases}1&\text{if }x=0,\\\frac{\sin(\pi x)}{\pi x}&\text{otherwise}.\tag{2}\end{cases}$$

Eq. 1 can be seen as resampling an $N$-periodic continuous-time signal from samples $x_n$ at times $n + Nk$ to samples $y_m$ at times $\frac{Nm}{M}$.

For example, a $2$-periodic complex discrete-time sequence $[x_0, x_1]$ can be resampled to a $4$-periodic sequence $[y_0, y_1, y_2, y_3]$:

$$\text{Eq. 1, }N=2,\,M=4$$
$$\Rightarrow\left\{\begin{align}y_0 &= x_0\\
y_1 &= \sum_{k=-\infty}^\infty\Bigg(\operatorname{sinc}\left(2k+\frac{3}{2}\right)x_0 + \operatorname{sinc}\left(2k+\frac{1}{2}\right)x_1\Bigg)\\
y_2 &= x_1\\
y_3 &= \sum_{k=-\infty}^\infty\Bigg(\operatorname{sinc}\left(2k+\frac{1}{2}\right)x_0 + \operatorname{sinc}\left(2k+\frac{3}{2}\right)x_1\Bigg)
\end{align}\right.\tag{3}$$

The two series in Eq. 3 converge conditionally, with for example these possible rearrangements of the first series that give conflicting results if $x_0 \ne x_1$:

$$\begin{gather}\sum_{k=0}^\infty\bigg(f(-k) + f(k+1)\bigg)\\= \frac{x_0 + x_1}{2},\\
\sum_{k=0}^\infty\bigg(f(-k) + f(2k+1) + f(2k+2)\bigg)\\= \frac{(x_1-x_0)\ln(2)}{2\pi} + \frac{x_0 + x_1}{2},\\
\sum_{k=0}^\infty\bigg(f(-k) + f(3k+1) + f(3k+2) + f(3k+3)\bigg)\\= \frac{(x_1-x_0)\ln(3)}{2\pi} + \frac{x_0 + x_1}{2},
\end{gather}\tag{4}$$

with shorthand $f(k) = \operatorname{sinc}\left(2k+\frac{3}{2}\right)x_0 + \operatorname{sinc}\left(2k+\frac{1}{2}\right)x_1$.

Under which condition does the series given by Eq. 1 converge absolutely?


texts: What is usual independence assumptions on adaptive filters

texts:
In this paper stands:

  The derivation and analysis of NLMS rest upon the usual independence assumptions.

It has a footnote:

  The independence assumptions used in the analysis of adaptive filters
  are:

  sequences $x(k)$ and $w(k)$ are zero mean, stationary, jointly normal,
  and with finite moments
  the successive increments of tap weights are independent of one
  another; and
  the error and $x(k)$ sequences are statistically independent of one
  another

I have several problems with that:

Who and when choose this assumptions? Is it something general or it just appears in the first publication on this topic?
I think in practice it is not possible to work just with stationary inputs $x(k)$. And also input and the adaptive weights also will never be zero mean (especially during online usage when it is impossible to normalize the input data). Also the error and input are strongly correlated, so how it can be statistically independent?
Is there some other theory dealing with analyzing those more real-life applications where those assumptions cannot be fulfiled?

If is it possible to answer, than please answer. If my questions are too stupid, please correct me. Thanks in advance.


texts: What are the different ways to find the envelope of a speech signal?

texts:
I am new to signal processing.

I want to find the envelope of a given speech signal.

When I searched about it, I found about Mean Hilbert envelope function. I want to know what other functions/methods can do the same and why Mean Hilbert envelope is considered the best?


texts: Questions on the Generalized Tikhonov Regularization

texts:
My first question is about the quadratic functional that is used in generalized Tikhonov regularization:
$$\Psi(f)=\frac{1}{2}\|f\|^2_\Gamma=f^T\Gamma f.$$
In the above equation what does $\Gamma$ represent, some special matrix?
Then, I don't understand why $\Psi(f)=\frac{1}{2}\|f'\|^2$ is preferable over $\Psi(f)=\frac{1}{2}\|f\|^2$ because
it imposes a penalty on the oscillations in the solution directly, rather than just a penalty on
the magnitude of the solution. Does that mean that the process is faster in the case we use derivative?
And one more question, I don't understand how to read the following figure:

Is the part on the right a result of denoising? Under the figure is written that we the covariance $C=\Gamma^{-1}=I$$ is used.


texts:
i am trying to reconstruct time series from SSA  ,because according to this link

http://en.wikipedia.org/wiki/Singular_spectrum_analysis

there is procedure

4th step: Diagonal averaging.

i have   with started following code

clear all;
  B=xlsread('data_generations1','A1','g8:g301');
  n=length(B);
  l =input('Give the size of the interval: ' );% Number of columns in the Data matrix
   m=n-l+1;%number of rows in the Data matrix
 X = zeros(m,l);
  for i=1:m
        X(i,:)=B(i:i+l-1);
  end;
  [U E V]=svd(X);

now  which procedure should i make?i should some   eigenvalues right?from example let us consider following code

>> E=E(:);
    >> stem(E);

in this case  i should  choose  first four eigenvalue right?what i would like  would be if i  will indicate starting index of eigenvalue and ending point of eigenvalue and i will reconstruct time series in these range,how can i do it?please help me


texts:
I am trying to figure out speech features that can be inverted to recover the audio back with no loss or as less loss as possible.

I am currently using the power spectrum which is completely reversible.

I also read about MFCC and LPC as potential features but both of them seem to be lossy in terms of recovering the audio.

Also is there a way to compute the power spectrum in the Wavelet domain and is it any better a feature than the power spectrum computed using FFT?

If there are any other features it would be great to know about that.

Thanks for the help.


texts: Distinguish between 2D and 3D objects according to depth

texts:
I'm trying to distinguish by code between a real 3D object and its picture - a 2D object, based on depth information.
However the picture (= the 2D image) might be captured from noisy background, so I need something more sophisticated than just having diversified depth information; also, the depth camera's output itself might be noisy and there isn't a straight-forward correlation between the model shape and the depth information.
For example: I have two pairs of color-depth images. One: color/depth pictures of a doll, second: color/depth pictures of a pictured doll. I want to create a flow that for pair no. 1 generates a "yes" output, and for pair no. 2 a "no" output.

Any advice - academical sources as implementation ideas - are very welcome.


texts: Splitting a Complex FIR Filter into Real Filters

texts:
I'm working on a software defined radio project on a PIC32 MCU. I'm using a CMX 973 quadrature frontend to provide I and Q. I'm independently low passing I and Q with carefully matched analog filters to reduce the overall bandwidth to 192 kHz, then digitizing it with an audio codec.

I'm going to be receiving a couple of closely-spaced channels so I'll need to filter them separately (bandpass), mix, and downsample. I'll also need to do some filtering for pulse shaping and PLL. These operations are all on complex-valued signals (I-Q).

The trouble is the PIC32 DSP library only provides an FIR filter implementation for real-valued filters. I can write my own complex filter implementation relatively easily, but it won't come with the benefit of optimization done by Microchip - I'll have to do it myself. I can do it, but I'd like to avoid it if I can.

Mathematically, is there any way to split a complex signal into I and Q and perform filtering using several real-valued filters which would have the same response as a complex-valued filter (particularly for bandpass filtering)? If so, how, and what are the limits to this approach?


texts: Detection of Troughs and Notches in a PPG Signal

texts:
I'm working a project which tries to determine Blood Pressure from PPG signals.I'm trying to extract the features as shown below...

I'm having problem in finding the troughs and dicrotic notch for each cycle and also the cycle start and end duration. Are there any manual method methods which can be applied ( I'm a newbie to signal processing )thereby which we can extract the trough and notch location in each cycle ?

Much thanks in advance


texts: Why is it that the input to an IFFT is first reordered in an OFDM Modulator

texts:
I am back with my questions! I recently came across a paper titled "Low Latency IFFT Design for OFDM Systems Supporting Full-Duplex FDD" where they claim a new method of IFFT input mapping to reduce the output latency. However, they have mentioned how in a conventional OFDM, the null subcarriers are mapped in the middle and the data subcarriers to the side. I have attached a picture of this. But my question is why is it done in the first place? Is it something to do with the efficient use of butterfly operation?
Also, please mention a reference where it is cited that conventional OFDM systems use this method of reordering before performing an IFFT operation.
Thank you


texts: Why use $\chi^2$ test to determine the presence of white noise?

texts:
I want to test for the presence of broadband noise in a snapshot 1000 complex baseband samples recorded by a software defined radio.

As a follow-up to this post, why was the $\chi^2$ test used? How many degrees of freedom should be used?

Also, how would one extend this approach to complex baseband data? I would assume that I and Q are iid Gaussian random variables. The magnitude of the complex data would then be Rayleigh distributed not Gaussian. Is there a generalization of the $\chi^2$ test for Rayleigh random variables? Or, would I just pick I or Q to operate on?

Update: I was able to find a paper: A test for whiteness. The author outlines a similar process.


texts: Gradient descent applying chain rule in state space setup

texts:
Trying to perform system identification in the following state-space model
$$
\begin{bmatrix} x_{1}(n)\\ x_{2}(n) \\ x_{3}(n)\end{bmatrix}=\begin{bmatrix} a_{11} && a_{12} && a_{13} \\ a_{21} && a_{22} && a_{23} \\ a_{31} && a_{32} && a_{33} \end{bmatrix} \begin{bmatrix} x_{1}(n-1)\\ x_{2}(n-1) \\ x_{3}(n-1)\end{bmatrix} +\begin{bmatrix} b_{11} && b_{12} \\ b_{21} && b_{22} \\ b_{32} && b_{23}\end{bmatrix} \begin{bmatrix} u(n) \\ u(n-1) \end{bmatrix}
$$

$$
y(n) = \begin{bmatrix} c_{1} && c_{2} && c_{3}\end{bmatrix}\begin{bmatrix} x_{1}(n)\\ x_{2}(n) \\ x_{3}(n)\end{bmatrix}
$$

$u$ in the input sequence and $y$ is the output sequence. If $p$ is any parameter in the model the following 'LMS rule' is used for estimating the parameter.

It is seen that the gradient of the output with respect to the parameter $p$ is needed. It is possible to compute these gradients with the expressions found in e.g. enter link description here. Experimentally I have verified that it works. So far so good.

All the parameters in the model I'm considering are computed from 6 underlying parameters $\theta_1, \theta_2, \theta_3, \theta_4, \theta_5, \theta_6$ which are the parameters that really need to be estimated/identified.

In a synthetic setup I'm keeping $\theta_3, \theta_4, \theta_5, \theta_6$ constant (pretending they are known) and only trying to estimate $\theta_1, \theta_2$. Both $a_{11}$ and $a_{12}$ depend on $\theta_1, \theta_2$. So I can write $a_{11}(\theta_1, \theta_2)$ and $a_{12}(\theta_1, \theta_2)$. Other parameters in the model also depend on $\theta_1, \theta_2$. My question is why I can't compute the gradients $\frac{\partial y(n)}{\partial \theta_1}$ and  $\frac{\partial y(n)}{\partial \theta_2}$ by

$$
\begin{bmatrix} \frac{\partial y(n)}{\partial \theta_1}\\ \frac{\partial y(n)}{\partial \theta_2} \end{bmatrix} = \begin{bmatrix} \frac{\partial a_{11}(\theta_1, \theta_2)}{\partial \theta_1} && \frac{\partial a_{12}(\theta_1, \theta_2)}{\partial \theta_1}  \\ \frac{\partial a_{11}(\theta_1, \theta_2)}{\partial \theta_2} && \frac{\partial a_{12}(\theta_1, \theta_2)}{\partial \theta_2}  \end{bmatrix} \begin{bmatrix} \frac{\partial y(n)}{\partial a_{11}}\\ \frac{\partial y(n)}{\partial a_{12}} \end{bmatrix}
$$

It may be a stupid bug but after serious debugging I'm starting to wonder if the above approach is fundamentally flawed, I just don't quite understand why it shouldn't work.


texts:
I am new to signal processing and Kalman Filtering here. Thanks for your help.

I working with an IMU for a tracking project where the IMU moves throw a known path but at an unknown speed (within limits), the objective being tracking the speed at which the IMU moved through the path. To my surprise, I couldn't find anything online on IMU tracking through a predetermined path.

The idea of using the known, 'predetermined trajectory', of the IMU as a constrain makes sense to me, using the path that we know that the IMU is going to travel through as a form of container. But I don't know if there is a flaw in my reasoning or if I'm missing something.

I thought a Kalman filter could be used to merge the accelerometer and gyroscope data and have it constrained to the trajectory as a way to limit sensor noise, but I rly can't get my head around how to do this! Maybe this is an optimization problem where the measured 3D trajectory is optimized into the 'predetermined trajectory' instead?

Ideally this could be applied to any kind of movement to which the trajectory is known, so I'm imagining this 'predetermined trajectory' as a 3D curve.


texts:
I move a device by sending a sine wave proportional to the displacement. I would like to modify the amplitude and mean value dynamically.

For example at the beginning I would like to go from :

Signal(t) = 1 * sin(t) + 1

to:

Signal(t) = 0.95 *sin(t) + 0.95

My issue is that I don't know how to do that without having a big step in my signal, which is unacceptable for my application.
For now, all I have is something that change the coefficient on a "long" time, by small step (1>0.99>0.98>0.97>0.96>0.95) so that the "steps" in the output signal remain small, but it is not very clean.


texts:
I have two iron pipes, one bent and cracked, and one whole. On one end Ive attached a vibration motor (200hz) and on the other end Ive attached a vibration sensor.

I do a fft and then get out the amplitudes of the different frequencies I pick up.

Question: I want to compare the signal picked up from the broken pipe to the signal from the whole pipe, how?

At the moment I calculate the "total" energy in the signal, by summing the amplitudes. However, this sometimes fail, especially if im testing a very broken pipe. I can reliably detect smaller damages to the pipes.

Correlation does not work, due to the shape of the signal would be similar, but there would be small variations in the harmonics of the main signal. Also the vibration motor is 200 hz +/- 10hz approximately. Suggestions? Visual check doesnt work as I want to build a completely automated system, where a LED light turns on if the difference in the signal is above some treshhold.


texts:
I ran FFT on three audio files and found that the results for some have more peaks than the other. Could anyone give me any conceptual explanation as to what determines these peaks? Below are plots of the audio sound envelope (left) and the corresponding FFT results (right). If I look at the plots on the right, e.g., the FFT for audio 1 has no peaks between 0.33 and 0.67 but the FFT for audio 2 and 3 do. I am not quite sure whether these additional peaks are meaningful or just artifacts of my particular sound file and FFT setup. More explanations about the audio files below.

Each peak in the audio plots represents a sinewave tone. The smallest inter-tone interval is 187.5 ms. Other inter-tone intervals could be 2x, 4x, or 6x187.5 ms. Each audio file lasts 5x3 seconds. The first row is the result from the exact same 3-second rhythm looped 5 times. The last two are the repetition of different 3-s rhythms. The inter-tone intervals in the three files are as follows:

Here's my FFT script:

n = length(sound);
nyquist = srate/2;
f = linspace(0, nyquist, floor(n/2)+1);
fourier_coef = fft(snd);
fourier_coef = fourier_coef/n;
amp = abs(fourier_coef);
amp = amp .*2;

Thank you.

Teresa


texts: Calculating spectral coherence coefficient (scc) - implementation help

texts:
I am trying to calculate the SCC of a cyclostationary signal. I have estimated the Spectral Correlation Function (scf) of the signal using FFT Accumulation Method (FAM). I implemented the following pseudocode in matlab:

function [Sx, alphao, f] = scf(x, fs, d_f, d_alpha)
    Compute N' = pow2(nextpow2(fs/df))
            L = N'/4
            P=pow2(nextpow2(fs/dalpha/L));
    N = P*L;    %total no of datat points to process
    x = x(1:N)
    Divide x into chunks of length N' with L overlapping points
    Apply Hamming window across each chunk
    Perform FFT
    Perform the downshift to baseband
    Multiply the baseband with it's complex conjugate
    Execute smoothing by means of P-points FFT.
end

where fs is sampling frequency, d_f is frequency resolution and d_alpha is cyclic frequency resolution

Now I have three matrices : $S_x^\alpha$, which is the SCF, $alphao$, which is a 1D vector the cyclic frequencies and $f$, which is a 1D vector the spectral frequencies. I need to calculate the Spectral Coherence Coefficient which is given by the following equation:
$C_x^\alpha(f) = \frac{S_x^\alpha(f)}{\sqrt{S_x^0(f-\alpha/2)S_x^0(f+\alpha/2)}} \forall f$

My questions are:

If I put $S_x^0(f-\alpha/2)$ in the denominator then won't the denominator essentially becomes $S_x^0(f)$ since $\alpha = 0$?
Will $C_x^\alpha$ be of the same size as $S^\alpha_x$?


texts:
I need to plot eye diagram for RRC filtered QPSK modulated signal. The specifications are given as follows

Sampling frequency : $1.024$ MHz

Symbol Rate : $256$ Kbps (Hence, Upsampling rate = $4$)

Roll off factor = $0.2$

So I wrote a matlab code, but the resolution of eye diagram plotted is very low. I used object commscope.eyediagram.

Increasing the sampling frequency gives a better resolution, but it also increases the number of taps in the RRC filter which would not be a viable option for hardware implementation.

Kindly suggest what changes I need to make to get a better resolution of eye diagram without increasing the sampling frequency?


texts:
My input signal is phase vector. I want to differentiate it to get frequency vector. My input signal is somewhat noisy. Here is the input signal.

This is the derivative of the input signal as calculated using

diff(inputSig)

When i differentiate this signal, I am not getting a smooth curve.
The output looks 'spikey'. I am guessing it is because of the noise in the input signal (is this 'derivative kick'?). How to avoid this and get a smooth derivative curve?


texts: Why do people say that the fast Fourier transform (FFT) “views”, or “interprets”, or “assumes” its input sequence is periodic? I ask this question because the activities of viewing, interpreting, and assuming can only be performed by a living creature with a brain.


texts:
My problem is similar to this one: Measure Sine Wave Amplitude from ADC Signal
I have a microcontroller that produces a sine wave by means of its DAC. I can choose the frequency anywhere between about 1 kHz to 10 kHz. The sine is 3 Vpp and has 1.5 V offset, so that it is an unipolar signal.
I use this sine wave to excite a passive network, and the network responds with a signal having a phase shift and a loss. What I want to do now is to estimate the loss in my network, so I need to measure its output voltage (which is also a sine wave with the same frequency).
Does it make sense to use something like a sliding FFT or a Goertzel to precisely determine the amplitude of the sine at the network's output, or is there maybe an even better approach?
My first thought after reading the linked question was that I could also use an FFT and determine the magnitude of the corresponding bin. I assume some CPU time could be saved if I implement it as a sliding FFT, or even use a Goertzel, since I am only interested in one frequency.


texts: Adversarial training: deep learning book

texts:
In the Deep Learning book of Ian Goodfellow, p. 261 it is shown how to build an "adversarial example" by adding to an image $x$ another image $x_{adversarial}$ build as epsilon times and image (same size) which is the sign of the gradient of the cost function $J$ with respect to $x$ (for the learned weights \theta of the network, is I understand correctly, i.e. fixed theta). I recall that the $x_{adversarial}$ looks like a panda to a human; human cannot see the small noise introduced in the image, but the DNN is fooled by it, and classifies it as a gibboon.

In mathematical form:
$x_{adverserial} = x+\epsilon\nabla_x J(\theta,x,y)$, where $x$ is the panda image, $y$ is the ground truth label and $\theta$ are the DNN's wheights which I assume are the trained weights wich will not be touched anymore.

However, I didnt read (dont think ived missed ?) WHY this works, i.e., can someone give an "intuitive" explanation of why doing this procedure makes the DNN classify the panda as a gibbon? It is not intuitive to me why this gradient image results in this gibbon being found (gibbon or any other image).

The book is available here: https://www.deeplearningbook.org/contents/regularization.html
p. 265 here (261 in my physical book)

side note: they take the gradient w.r.t. $x$ and not w.r.t $\theta$ as would be the case for the training. And also if they were taking it w.r.t $\theta$ the shame would not be the same. But I would like to know why it makes sense to take is w.r.t x and how that can fool the network into "thinking" that this is another image.


texts:
At the receiver end of a digital communication system, the matched filter is designed with impulse response matched to the effective signal that is given as : $$x_{(z,1)}^{*}(T_p-t)-x_{(z,0)}^{*}(T_p-t)$$
where $x_{(z,1)}(t)$ corresponds to a 1 and $x_{(z,0)}(t)$ corresponds to a zero.
But every where I check in the notes or the textbook I see that h(t) is gets conveniently modified from $$x_{(z,1)}^{*}(T_p-t)-x_{(z,0)}^{*}(T_p-t)$$
to
$$x_{(z,1)}^{*}(t)-x_{(z,0)}^{*}(t)$$
and the square of this is calculated as the euclidean distance.
I do not understand the rationale behind this.


texts:
I have a guitar music signal and I want to detect the onset points via energy.

This is the signal example:

This is the energy plot:

My question is what would be the best method defining the threshold and consequently finding the peaks. I reckon I will have to set a window length and a window step (I am thinking 1000 and 100 samples respectively on a 44.1KHz sampling rate) and then every loop defining a new threshold (adaptive/local threshold). Every loop I would have to find the window average and compare it to the threshold. I have these questions:

1) Does window length = 1000 samples and window step = 100 seems reasonable?

2) How the threshold would be defined each loop and in relation to what?

3) If a window is above length which samples in it would I consider peaks? I think it would be somewhere in the middle but what range around it?

Maybe, window middle - window step < peak samples < window middle + window step  ?

Thank you for your help.


texts:
I'm not sure if is the correct location for ask this question. If not please info me the correct StackExchange site.
As this wikipedia page show, there is one YUV format of image as YUV420 and YUV411.

I know what is YUV, but what those 420 and 411 means?


texts: Given a plot of both the magnitude $|H(\omega)|$ and its angle, How can you find the $H(\omega)$?

texts:
I'm specifically trying to use an inverse Fourier Transform to find $h(t)$, but I'm finding it difficult to get $H(\omega)$ in the first place.

I'm under the impression from my textbook that $H(\omega) = |H(\omega)|e^{j\arg\{H(\omega)\}}$, and that $h(t)$ would just be the inverse Fourier Transform of that.


texts: Converting a discrete real time domain to a discrete complex time domain signal

texts:
To test my understanding of amplitude modulation in the frequency domain I'm trying to replicate the center frequency with 2 side-bands in an Octave plot with the following code

t  = [ 0 : 1 : 4095];
Fs = 2500000;
Fc = 1000000;
Fsig = 100000;
carrier = 20*sin(2*pi*Fc/Fs*t)';
signal = 10*sin(2*pi*Fsig/Fs*t)';
modulated = carrier .* signal;

plot(abs(fft(modulated)))

And I'm getting the following plot

I suppose I'm getting the 2 peaks mirrored instead of a single central peak with 2 symmetrical side peaks because it's an FFT of a real signal and I need a complex signal instead.

How do I convert the real time-domain signal to a complex time-domain signal assuming the center frequency is Fc?

Edit:

To state the question more clearly.
How do I get an FFT which will have one peak at the center frequency and 2 side peaks (3 peaks total) from my AM signal above?

I understand that I'm getting what I'm getting because the AM signal is real.

So I suppose I need a complex time-domain signal to feed to fft instead.

Is it possible to convert my real AM signal to a complex signal somehow for the FFT of the complex signal to look similar to the below (photoshopped)?

I suppose that's what quadrature sampling does in a receiver, but how do I do this in the digital domain?


texts: Expectation of a constant diagonal matrix

texts:
Is the expected value of a diagonal matrix with constant entries equal to the mean value of the entries?

My question stems from the following observation in a paper.

Given a real diagonal matrix
$\Lambda_{i}[n] = \mathrm{diag}\{\rho_{i,1}[n], \rho_{i,2}[n], \dots, \rho_{i,N}[n]\}$, where $\rho_{i,q}[n] = J_{0} \left(\frac{2 \pi v^{(i,q)} f_{c} n T_{s}}{c}\right)$ and $v^{(i,q)}$ is a random variable uniformly distributed in $(0, V_{\mathrm{max}})$, it is shown that

$$ \mathbb E[\Lambda_{i}[n] (\Lambda_{i}([n])^{H} ] = \mathbb E[(\Lambda_{i}[n])^{2}] = \bar{\lambda}[n] \textbf{I}_{N}$$

where $\bar{\lambda}[n] = \frac{1}{V_{\mathrm{max}}} \int_{0}^{V_{max}} J_{0}^{2}(\frac{2\pi v f_{c} n T_{s}}{c}) dv$ is the mean value of the diagonal entries in $(\Lambda_{i}[n])^{2}$.

Using the above observation I wish to evaluate the following expression:

$$\mathbb E[\Lambda_{i}[n] \mathrm{D_{\eta_{i}}}[n] (\Lambda_{i}([n])^{H} ]$$

where, $\mathrm{D_{\eta_{i}}}[n] = \mathrm{diag}\{\eta_{i,1}, \eta_{i,2}, \dots, \eta_{i, N}\}$  is a diagonal matrix with constant entries. Is it correct to evaluate the expression as follows?

$$\mathbb E[\Lambda_{i}[n] \mathrm{D_{\eta_{i}}}[n] (\Lambda_{i}([n])^{H} ] = \bar{\eta_{i}}[n] \bar{\lambda}[n]$$

where, $\bar{\eta_{i}}[n] = \frac{\eta_{i,1} + \eta_{i,2} + \dots + \eta_{i,N}}{N}$ and $\bar{\lambda}[n] = \frac{1}{V_{max}} \int_{0}^{V_{max}} J_{0}^{2}(\frac{2\pi v f_{c} n T_{s}}{c}) dv$

If yes, is there a proof for it?


texts:
can anyone please help me with finding Convolution for following problem .....

1) $h(n) = \delta[\sin(1 + |n|)]\quad \text{and}\quad x(n) = \sin(n^2)$

2) $h(n) = \delta[\sin(2\pi n/N)] \quad \text{and}\quad x(n) = n^2$ where $N$ is odd.


texts:
I am implementing OFDM PHY for Visible Light Communication in FPGA. (I am quite new to communication system and signal processing, so please understand my lack of background knowledge.)

The FFT size is 64 and it use Hermitian symmetry. The preamble symbol (64 sample) is added in front of the data symbol for synchronization, so for one OFDM symbol consists of 128 time domain samples. This sample is sent to DAC every 200ns (DAC clock is 5 MHz). The DAC maximum update rate is 125 MSPS and the output is connected to the LPF that has 50 MHz bandwidth (-3dB). The DAC output is shown in the following figure.

As shown in the figure, the OFDM signal is ringing on every transition. I think this ringing is caused by sharp transition that is filtered by LPF, so the high frequency harmonics is removed. In the receiver, the ADC sampling clock is 125 MHz, so I have to undersampling it by a factor of 25. The undersampling process is done by pick up one sample in every 25 samples. The OFDM signal after undersampling is shown in the following figure.

As shown in the figure, I think because of the ringing, and the ringing signal is picked up in the undersampling process, then the signal amplitude is decreased or increased.

Question 1: Is the DAC implementation correct, or I need to add oversampling and pulse shaping before DAC? so the output is not ringing?

Question 2: Is there any solution how to remove this ringing in the receiver?


texts: How to accurately count the time period (hardware)?

texts:
Input : Square wave which sweeps over time domain. (about 1 MHz)
Output: The time period of high/low value.

Like the timer does, I would like to know the actual time (in sec) when the input goes high or low as well as the proper way to implement it.

For example, use FPGA or Microcontroller to read it via analog input.
OR there is the tool that straight to the point! Please let me know.


texts: Why should wavelet re-synthesis produce an output when the main component is suppressed and what does this mean for denoising?

texts:
I understand that aliasing occurs in DWPT if the wavelet used is of low order since the "filters" are not perfect and the combination of down sampling and overlapping between bands causes aliasing.
I am using low order wavelet as I aim to implement the process in real-time and I have limitations on the number of filter taps.
Doing some simulations in matlab I saw aliasing in two cases:

One case I saw it when I decomposed a signal to a tree and I plotted
FFT of a certain node but when I reconstructed the tree I noticed
that aliasing was canceled.(basically did not alter the coefficients only decomposed viewed and reconstructed).

Doing the same thing as above but thresholding the node or compressing the coefficients to zero the aliasing was still present after reconstruction.

I compressed level 22 coefficients to zero.

So can I conclude that aliasing will always occur if I am using a low order wavelet say 'db4' and I manipulate the coefficients?
If so how is wavelet such famous denoising tool and aliasing can be this bad?


texts: Help me with BM3D algorithm's aggregation scheme

texts: BM3D  is considered state of the art in Image Denoising. I am trying to implement the algorithm in Matlab. Right now, I am done with the 3D wavelet transform in the first step, and to be precise, the equation 3 in the aforementioned paper. What I want to do now is to carry out the equation 5 on my de-noised patches in 3D domain. Can someone please explain the equation 5, the aggregation scheme, a bit more lightly?


texts: Is the book wrong? -- How to sketch frequency response obtained from H(z)?

texts:
This question is directly related to digital signal processing, so I am asking here.
How to sketch frequency response obtained from $H(z)$?
I'm adding an example and its solution below. I did not understand some of the things for question 7.4, part D.
Any help is appreciated!

There are three points in graph. How and why the second from left is placed there? What's its purpose?
I have no idea how phase graph is created. What is the relation between x and y axis? What do they actually represent?
Why the book says "give me function of frequency" but the solution has $\omega/2\pi$ in x-axis?

Question 7.4:

An LTI system is described by the difference equation
$$y[n] = \frac{1}{3}(x[n]+x[n-1]+x[n-2]) $$
a. Determine the system function $H(z)$ for this system.
b. Plot
the poles and zeros of $H(z)$ in the z-plane.
c. From $H(z)$ obtain
an expression for $H(e^{j\hat{\omega}})$, the frequency response of
this system
d. Sketch the frequency response (magnitude and phase)
as function of frequency for $-\pi \le \hat{\omega} \le\pi$.
e.
What is the output if the input is
$$x[n]=4+\cos[0.25\pi(n-1)]-3\cos[(2\pi/3)n] $$

Solution:


texts: What is the purpose of the following code?

texts:
So I'm attempting to setup a LED visualizer using a python library called Impulse. I've already repaired some of the initial issues with the code in my own custom fork, and now I'm attempting to change the chunk size to something a bit more high-resolution. I got the idea from this question, but the issue is I'm a bit lost as to what a certain part of the code does.

I've kinda hit a wall. The bit of code is here. I don't understand what it refers to by fft_max, but I need to figure out what it is so I can determine how to calculate and expand the array to match the higher sample chunk. I apologize if this is in the wrong section, as it is highly related to programming, but I figured someone here might know what fft_max might be referring to.

Here is a plot of fft_max:


texts:
So, In my report I am comparing the related works, In most of the previous work, researchers have used spectrogram as input to vanilla CNN and classify. Where I am using different handcrafted features from the signal and then feeding it to DNN.
I want to explain why the second method works better than first, for that I am comparing like this

Motivated by prior work, Several AI-based approaches have been
proposed to classify sounds using signal analysis. Most of them use
short-term magnitude spectrograms transformed from sound data as
input to Convolutional neural network (CNN). The drawback of this
method is, Since CNN is based only on a spectrogram input, some
domain-specific important characteristics might get missed in the
feature space. Such as Zero crossing rate(ZCR), Skewness, Shannon
Entropy, Fundamental frequency (F0), Formant frequencies etc

I just wanted to know, Is this statement correct from DSP aspect? because I am saying in my statement that spectrogram doesn't contain zero-crossing rate(ZCR), Skewness, Shannon Entropy, Fundamental frequency (F0), Formant frequencies etc


texts: How do I interpret an image of a spectrogram of an audio wind signal?

texts:
I am running the following code in python to get the spectrogram of a audio signal of wind:
import librosa
import numpy as np
#  Load the audio as a waveform `y`
#    Store the sampling rate as `sr`
file_path = "wind.wav"
y, sr = librosa.load(file_path, sr = None, mono=True, offset = 0.0,  duration=None)
D = librosa.stft(y)
librosa.display.specshow(librosa.amplitude_to_db(D,ref=np.max),y_axis='log', x_axis='time')
plt.title('Power spectrogram')
plt.colorbar(format='%+2.0f dB')
plt.tight_layout()

I get the following image:

My question: How do I interpret this image? What exactly am I looking at and what are the frequencies in this audio file?


texts: Non radix-2 FFT hardware implementation : zero-padding vs custom algorithms

texts:
I am an FPGA engineer with some DSP experience, facing the situation of implementing a 1023 points FFT in a spread spectrum demodulator.

As a straightforward solution, I would zero pad to 1024 and use an IP. But I have been given the task to optimize the design : the key parameter here is area, since the sample rate is really low (< 30 Msps) and there is possibility of reusing logic, but latency optimization would be also interesting.

My question is: can anyone refer me to bibliography hinting non-radix 2 FFT implementations comparing performance/implementation constraints tradeoffs?

thanks


texts:
I'm trying to solve the following maximum likelihood estimation but for multiplicative noise instead of additive noise:
So the goal is to do ML-estimation for a scalar constant $x$, which is multiplied with noise:
$$\tilde{d}[n] = a[n]x$$
The noise $a[n]$ is a realization of the i.i.d. random variable $A \sim \mathcal{N}(\mu_A, \sigma_A)$.
The probability density function is given by
$$ \pi(x,\mathbf{\tilde{d}}) = \frac{1}{x^N} \pi_A\left(\frac{\tilde{\mathbf{d}}}{x}\right)$$
with $\pi_A$ being the pdf of $A$.
Now I took the natural logarithm of this expression and derived with respect to $x$, which let to the following term:
$$\frac{\partial}{\partial x} \ln\left(\pi(x,\mathbf{\tilde{d}})\right) = -\frac{N}{x} + \frac{1}{\sigma_A^2} \sum_{n=0}^{N-1} \left[ \frac{\tilde{d}[n](\tilde{d}[n]-\mu_a x)}{x^3} \right] \overset{!}{=}0$$
But how do I continue from that? My idea was to solve this equation for $x$, but I can't figure out a closed form solution...


texts: Pitch estimation using the autocorrelation method

texts:
I have the following code:

// input: speech segment
[y,Fs,bits]= wavread('/media/A03036C33036A068/scilab/30msec_voiced.wav');
max_value=max(abs(y));
y=y/max_value;
t=(1/Fs:1/Fs:(length(y)/Fs))*1000;
subplot(2,1,1);
plot(t,y);
xtitle('A 30 millisecond segment of speech','time in milliseconds');
sum1=0;autocorrelation=0;
for l=0:(length(y)-1)
    sum1=0;
    for u=1:(length(y)-l)
        s=y(u)*y(u+l);
        sum1=sum1+s;
    end
    autocor(l+1)=sum1;
end
kk=(1/Fs:1/Fs:(length(autocor)/Fs))*1000;
subplot(2,1,2);
plot(kk,autocor);
xtitle('Autocorrelation of the 30 millisecond segment of speech','time in milliseconds');
auto=autocor(21:160);
max1=0;
for uu=1:140
    if(auto(uu)>max1)
        max1=auto(uu);
        sample_no=uu;
    end
end
pitch_period_To=(20+sample_no)*(1/Fs)
pitch_freq_Fo=1/pitch_period_To

In this, I am not getting the meaning of pitch_period_To=(20+sample_no)*(1/Fs). Why did they add 20?


texts: Is my algorithm about blob tracking for vehicle following correct?

texts:
I'm doing vehicles tracking project. The video is a one-way, no vehicles occlusion.
After doing background subtraction, erosion and dilation, I get bounding box objects for each frame, and I can find $centroid(c_x,c_y)$ from that.
So, the next thing I want to do is blobs tracking. Here is what I'm thinking on how to do the blobs tracking:

At first frame, store all (cx,cy,id)
Next frame, calculate distance each new (cx,cy) with each of old (cx,cy)
If distance < threshold, update the old (cx,cy) which qualify the formula
If distance > threshold, check if the cx,cy is near the entry coordinate (e.g. around x,y=0-640,0-40), if yes store new (cx,cy).

Is it right and possible to apply to tracking?


texts: Constrained LASSO Problem - $ {L}_{1} $ Regularized Least Squares with Linear Equality Constraints

texts:
I have an optimization question.

I want to solve the following problem:

$$
\arg\min_S\frac{1}{2}\|s-c\|_2^2 +\lambda\|\Phi s\|_1 \mbox{ s.t. } As = 0
$$

in which $\Phi$ is the wavelet transform operator.

My strategy is to find the close form solution of the lasso problem by using the orthogonal invariance property of $\Phi$, and then we project the solution onto the affine space.

I think this method will not converge to the optimal solution, but the numerical results shows good.

Is there any efficient method to solve this kind of problem?


texts: system identification: MATLAB tfestimate gives different results for different Fs

texts:
So I have an experimental data; A is a chirp signal (sweep sine wave) and B is the response of the system. I identify the system as follows in MATLAB:

figure
Ts= 1e-4;
Fs = 1/Ts;
[T,f]=tfestimate(A,B,[],[],[],Fs);
semilogx(f,20*log10(abs(T)));
grid

But when I change Ts to different values (e.g. 1e-2), the plot changes. For instance

This is with Ts = 1e-2

This is with Ts = 1e-4

Can anyone help me figure out what the correct value of Ts is, so my reported eigenfrequencies are correct?


texts:
I have very short signals (usually 100 samples from a 44100 hz audio recording ). These are 'bang' noises that a hammer makes on a piece of metal. I want to use these short signals as input to some analysis (and a machine learning algorithm). I am not experienced in sound processing but from what I've gathered one of the most informative features you can use from a sound recording is the MFCC. I am using python's scikit talkbox package to compute the mfcc of my signals. The problem is that this package requires the signal to be at least 300 samples long (and as i've said mine are about 100 samples long and sometimes shorter).

I wanted to know if there is a different process I should be doing in this case to calculate the MFCC or if there are other suggestions for other methods, besides the MFCC, that I should be using.


texts: Use of an impulse-response system to model sediment transport along a river reach

texts:
I am new to signal processing and have come into the subject from the study of rivers and basic geophysics. I am trying to test an idea previously put forward that the sediment transport response of rivers can be modeled as a linear impulse-response system. Transport along a river reach changes as the upstream supply of water or sediment changes. Working from an impulse response convolution, I derived an algebraic equation for the sediment transport (flux) of a river reach as measured at the downstream end of the reach. Here is the derivation of the algebraic equation (Equation 27 below), and I apologize in advance because I prepared the write-up snippet as an image from the master LaTex file:

When I use Equation 27 to model the measured sediment transport at the downstream end of a river reach I observe that when the system is perturbed by an increase in the supply of water and sediment at the upstream end (elapsed time ~2100-2400 and 4050-4310 minutes in the Figure that follows), Equation 27 predicts the mirror image in behavior of what I measure. This is depicted in the following figure:

In the Figure the measured transport is the heavy dark line, the modeled response with Equation 27 is the light blue dotted line, and the inverse of Equation 27 for periods of supply perturbation is the dark gray dashed line. Note that to calculate the responses shown in the Figure I reset the elapsed time when the upstream supply changes - but here I am plotting the results against the running elapsed time. It can't be a coincidence that the piece-wise modeled-inverse curve (dark gray dashed line) does a pretty good job of matching the measured transport. However, I have no idea why nor do I know if I can arrive there mathematically from the starting point of Equation 20. Any assistance or guidance on this would be greatly appreciated.


texts: Is it valid to increase amplitude (and presumably FFT quality) by simply scaling the data?

texts:
I'm using a version of "KISS FFT" by Mark Borgerding.  It accepts an array of 16-bit fixed-point input values and produces a 32-bit float result array.

I've discovered that if the input amplitudes are low many of the float result values come out zero, but if I simply scale the inputs (by, say, the factor 16) then fewer output values are zero and therefore the output seems to contain more detail.  (Not that it matters much for my purposes, but for consistency I then divide the resulting float values by the same scaling factor.)

Anyway, this seems to work, in terms of producing a result when previously I'd have just gotten a buffer of virtually all zeros, but I'm wondering if there's some reason it might not be a valid approach.

(Note that this approach means that there's a lot more "coarsness"/granularity to the data, and, in particular, the low-level noise that would normally be present is not.  I'm almost wondering if it would be wise to inject some low-level noise to replace the zero values in the input.)


texts: Is it possible to apply inverse Fourier transform (I-FFT) to the following image?

texts:
Suppose, I have this image in my hand and nothing else. Clearly, this is a Magnitude-plot of some unknown image.

Is it possible to apply an Inverse Fast Fourier Transform (I-FFT) operation to recover the original Grayscale image from this image?

N.B. For more information and actual C# source code, please follow this link.


texts: FFT equivalent for generalized unitary transforms

texts: The DFT has the FFT, Hadamard transform has the Fast Hadamard Transform and so do a number of other unitary transforms (operators). Is there or has there been an attempt at creating FFT style algorithms for generalized unitary transforms?


texts:
Could anyone explain to me how can I know the filter order based on algorithm?

For example:

$y[n] = \frac12 x[n] – x[n–1] + \frac12 x[n–2]$ has order filter 2.
$y[n] =2 x[n] – x[n–1] + y[n–1]$ has order filter 1.
$y[n] =2 x[n] – x[n–1] + x[n–2]+ y[n–1] + y[n–2]$ has order filter 2.

Why?


texts: Time frequency analysis for a spreading signal

texts:
I am a beginner in digital communications: I am studying the spread spectrum communication and I have a question on the spreading signals. For example I have 2 spreading signals and I do a time frequency analysis.

Should the spreading signals overlap in time? And if yes, why?


texts: Suitable metrics for summarizing or visualizing the spatial activation of components after temporal Independent Component Analysis (ICA)

texts:
I will first describe the Independent Component Analysis (ICA) steps, so that the question becomes clearer, and more relevant to similar questions.

Assume we have $N$ sensors distributed in space. From each sensor we obtain a time series of length $T$. We collect these time series as rows in an $N \times T$ matrix $X$. After performing ICA we obtain a decomposition of the form $X = DS$, where $D$ is an $N \times N$ matrix of weights, and $S$ is an $N \times T$ matrix whose rows are the independent sources. To find the contribution of the $i$-th component to the observed signal we then multiply the $i$-th column of the matrix $D$ with the $i$-th row of $S$. The result is an $N \times T$ matrix which we will denote as $X^{i} = D_{*,i}S_{i,*}$. Then we can write: $X = X^{1} + ... + X^{i} + ... + X^{N}$.

In many domains I see single-picture visualizations of the spatial activation of the $i$-th component from ICA. However, it is not clear to me what metric to extract from each row of $X^{i}$ or from matrix $D$ in order to do this. Is it a summary statistic of the rows of $X^{i}$, e.g. the energy of the signals (rows) of $X^{i}$, the weighting coefficients from the $i$-th column of $D$, or something different altogether?

Thank you.


texts: Why is random noise assumed to be normally distributed?

texts:
From residual in the linear regression to noise in signal processing are assumed to be normally distributed? By considering them as normally distributed we are kind of telling the pattern in the noise but shouldn't noise be considered random. This seems contradictory to me as on one side it is random then on the other side their distribution is considered normally distributed. Shouldn't the noise distribution be just random?

I believe there is some lacking in my understanding of the concept of statistical distribution which has lead me to this confusion, or I am looking at it all wrong.

One more example- when one augment data by adding Gaussian noise then it is not expected to change the overall distribution of data, why?


texts: How to account for sample rate in a FIR Digital Filter?

texts:
As a learning exercise I am trying to simulate a simple notch filter with Matlab. For test purposes  I use Matlab to simulate sinewaves of various frequencies and plot frequency vs. gain so I can see the effect of the “notch”.

I’m using the difference equation $$y(n) = x(n) - 2  \cos\theta\cdot  x(n-1) + x(n-2)$$ for this simple notch filter where theta is the notch (say $\pi/3$)

I thought x(n) would be the sample input from the sinewave I generate as test input. I'm just not sure how to account for the sample rate when determining the value of y(n).

From what I expect, and with comparison to using freqz([1 -2*cos(theta) 1],1),  I get a good match with a sample rate of 10 and a difference equation as shown below.

$$y(n)=  f_s [x(n) -2\cos(\theta/f_s)\cdot x(n-1) + x(n-2)]$$

but, as I change the sample rate there is a huge effect on the gain.

What am I missing?  My guess is I just don't understand how to account for a change to the sample rate in the difference equation but I haven't seen a good write up on this anywhere

Can anyone help?

The simple code is shown below.  As I change sample rate (from 10 to 100 and 1000) the frequency response appears to be correct but the gain appears to be decreasing by 20dB for each power of 10 I increase the sample frequency. Maybe that’s the clue?

..... CODE ..  (You can tell I'm quite new to Matlab also... apologies for style!)

fs=10;  %Specify Sampling Frequency

Ts=1/fs; %Sampling period.

fb=100;    % Number of frequencies to try

mb=zeros(fb,2);   %Results   (Max / Freq)

w=0.001;           %Frequency of input wave to be samples  (Don't use DC!)
fb_indx=1;         %Index into the results array

THETA=pi/3;          %For a simple test
while fb_indx < (fb+1)

    Ns=round(2*pi*fs/w);  %Nr of time samples to be plotted.

    t=[0:Ts:Ts*(Ns-1)];  %Make time array that contains Ns elements
                     %t = [0, Ts, 2Ts, 3Ts,..., (Ns-1)Ts]

     mb(fb_indx,1)=w;  %Store current test frequency

     y=zeros(1,Ns);     %Result (y(n))

     x=sin(w*t); %create sampled sinusoids at different frequencies

% Here for the notch

  for n = 3:Ns  % loop for number of samples

     y(n) = fs*(x(n)-(2*cos(THETA/fs)*x(n-1))+x(n-2));  % calculate y

  end

% Obtain max. response
  M=max(y);                %Look for highest peak in result

  mb(fb_indx,2)=20*log10(M);  %and store in 20log10 value

    fb_indx=fb_indx+1;

      w=w+(pi/fb);  %Get next frequency

  end;

% Plot result

figure % create new figure

subplot(2,2,1)           % first subplot

plot(mb(:,1),mb(:,2));
xlabel('Freq - rad/s');
ylabel('20log10 Magnitude');
axis([0 pi -100 20]);

grid on;

subplot(2,2,2);
plot(x);
title('Input');

subplot(2,2,3);
plot(y);
title('Output');


texts: Relationship between frame rate and sampling frequency in speech signal processing?

texts:
While I was going through the short time processing of speech signals, I got stuck at the relationship between the frame rate and the sampling frequency.

Is there any relationship between them for an audio signal so that the change in sampling frequency will have an effect in the frame rate? If yes, what is mathematical relationship between them for given values of window length (L), window shift (R), Sampling frequency (Fs) and Frame Rate (FR)?


texts: Fourier transform of a signal and its autocovariance function

texts: While I do know the difference between the two, in theory, I am not very sure about why we look at the Fourier transform of the auto-covariance function. What extra information does it give us over and above what we can already get by taking the Fourier transform of the original time-series? Also, when is one advantageous over the other?


texts: resources for learning more about pedestrian tracking

texts:
I would like to build a computer vision application capable of doing robust pedestrian tracking in potentially crowded environments from a single video source. To this end I would like to find resources in order to learn as much about the current state of the art as possible. This could be:

recent survey papers
papers outlining novel approaches that have been demonstrated with success
open-source applications or algorithms
online courses or even course materials such as slide decks comparing different approaches
...

Is there anything along these lines that you could point me to? Thanks.


texts:
Can someone explain to me what each element of the 1D FFT algorithm are (i.e. N,x,n,j,k) ? From here, http://zone.ni.com/reference/en-XX/help/371361H-01/lvanls/fft/#details

(Can't post pictures on stackoverflow just yet.... but its the 1D FFT description)


texts:
Can GCC-PHAT be used to detect multiple time-delays (that is, having multiple acoustic sources simultaneously)? The documentation for the gccphat(sig,refsig) function says that it assumes both sig and refsig came from a single source.

If  it is the case that gccphat(sig,refsig) can indeed only take into account a single source, can you recommend other approaches I could try to detect multiple sources? I am fairly new to this field so I could appreciate all the help. Thanks.


texts: Do I need the sampling frequency in order to gain periods out of FFT?

texts:
Currently I am using the transformInPlace() method from here.

for a project at university.
First of all I thought FFT would be the perfect solution for my problem, but
now I am not so sure anymore.
I have to alter a certain component of a software called LIMBO.
LIMBO is a load intensity modeling tool.
Every webpage has a trace that records the number of site views during a fixed period of time.
This leads to trace files like this data.

You can see lots of (time, arrivalRate(time)) pairs. This is all LIMBO gets as input.
The goal is to search for dominant periods within the noisy trace via the FFT.
The problem are the time values of the (time, arrivalRate(time)) pairs.
For a fixed time (for example 1 day) the page counts views. The total number of views than is
stored inside arrivalRate(time).
Then the page listens for another day in order to calculate the next arrivalRate(). This process is repeated
the whole time.
So, the time values inside the trace (for example 0.5,1.5,2.5) are not necessarily days (They  could be seconds, weeks or even months as well). They are abstract and depend on individual fixed listen period of every webpage mentioned above. (probably listen period  is called sampling frequency but I am not sure)
Therefore the information about the listen period of the page can not be retrieved out of the trace file.

My question is:
  Is it a problem to know nothing about the listen period of the given page if I want to calculate and interpret dominant periods
after a FFT has been applied on the trace file?

For example I use this formula to calculate $f_i $(the frequency of the $i$-th array position)

$i$: current position in the array

$N$: length of the array

$f_s$: the sampling frequency that is probably not revealed in the trace (so far I just used values like "1" or the median of all arrival rates in the trace)

$i = N f_i/f_s$   (so I use $1/f_i = {\rm period}_i = N/(f_s i)$ for calculating the $i$-th period)


texts:
Wikipedia says in bilinear transformation from \$s\$ domain to $z$ domain relation is

$$\boxed{s \longleftarrow \frac{2}{T}\frac{z-1}{z+1}}$$

But here this relation is given like this

$$\boxed{w=\frac{z+1}{z-1}}$$

What is difference between this two?


texts:
I have measured the output of a mechanical system and obtained the signal shown at the attached image. I want to make it smoother by removing the chattering (I think it is called chattering). In order to achieve this I used a filter with transfer function:

$\ T(s) = \frac{30}{s+30} $

I used this filter to filter the measured data and the result was the the signal at the attached image. I would like to further process the signal to make it as better as possible. Can I achieve what I want by using another type of filter or is there any other process to follow ?


texts: What Is the Cause for Poor Results with Adaptive Thresholding?

texts:
I try to run text cleaning process based on the camera captured image.

By using OpenCV adaptive threshold method with parameter (255.0D, AdaptiveThresholdType.MeanC, ThresholdType.Binary, 15, 10.0D), almost all gives satisfactory output but below example gives poor cleaning result (background is not removed well).

(image from http://www.fmwconcepts.com/imagemagick/textcleaner/index.php)

Question 1. I'd like to know which factor cause poor result in this example.

My Question 2 is, which approach can descriminate my attempt(OpenCV) is failed based on the above result? Or, which approach can help to decide whether AdaptiveThreshold will fail or not before running it?

IMO, the pass/fail factor can be a number of background particles but I don't know how to measure it.

I tried Erode method in OpenCV to remove particles, but it gave over whitened result and made too skinny text.


texts: Showing linear-phase frequency response when only real part is known

texts:
I'm studying for an exam, and this particular practice problem is missing the solution:

  Given a causal LTI system where only the real part of the frequency response is known,
  $$\Re\left\{H(j\omega)\right\}= 1 + \cos(\omega)
$$
  show that the system has a linear-phase frequency response.

I know that systems with constant group delay have linear phase, but I can't figure out how to get the group delay without the imaginary part, since group delay is
$$
\tau(\omega)=\Re\left\{\frac{\mathcal F[th(t)]}{\mathcal F[h(t)]}\right\}
$$
and
\begin{align}
\Re\left\{\mathcal F[th(t)]\right\} &= \Re\left\{j\frac{d}{d\omega}H(j\omega)\right\}\\
& = \Re\left\{\frac{d}{d\omega}[jH_{\rm real}(j\omega)+j^2H_{\rm imag}(j\omega)]\right\}\\
& = -\frac{d}{d\omega}H_{\rm imag}(j\omega)
\end{align}

Is my approach right but I made a mistake or can't see some trick, or am I going down the wrong path?


texts: Artificial Neural Network Preprocessing in Real-Time Applications

texts:
I've come across an issue with my ANN when attempting to port my offline analysis to an online, real-time, application.

I currently train my algorithm using an array of input data, number of channels (columns) against number of samples (rows), and I preprocess the data by subtracting the samples mean and dividing through the standard deviation. This works well, and I'm getting accuracies for each of the output target values (4 targets in total) around 98%.

However, in a real-time application, where only one sample is arriving at a time, I cannot apply this same preprocessing method, as I can't determine the mean and STD on a single sample! So far this is purely a feed-forward problem, using saved weights from the offline analysis.

The obvious solution is to not use that preprocessing method, but it's the only way I can get working results. If I remove the preprocessing method all together the ANN just doesn't work, and all estimates are put in the first target value. Same goes for trying to preprocess the data based on the single sample (i.e. the same method mentioned above but determining the mean and STD on the data x axis, instead of the y axis).

I have two questions:

1) Why is preprocessing in this manner necessary? What is happening when I subtract the mean and divide through the STD that makes everything work?

2) What can I do to correct this issue? The only idea I have is to save the mean and STD value for real-time processing, and then update the mean/STD as new samples are presented.

Ideally I want a preprocessing method which I can perform on a single sample, or no preprocessing at all! Failing that, any suggestions on how you would go about this issue would be great.

Thanks.


texts: What is plotted against the DFT of a windowed sampled signal?

texts:
I'm given a continuous-time analog signal $x_a(t) = \cos(2\pi f_1t)+\sin(2\pi f_2t)$, for some frequency $f_1, f_2$. I'm asked to sample $x_a(t)$ at $F_s=1024\textrm{ Hz}$, apply a 128-point Hamming Window, and take the DFT(Discrete Fourier Transform) of the resulting windowed, sampled signal.

The expression for a sampled signal is:

$$x[n] = x_a\left(\dfrac{n}{F_s}\right)$$

To apply the hamming window, we multiply $x[n]$ by the 128-point window function (courtesy of ML):

$$x_w[n]=x[n].*\mathrm{hamming}[128]$$

We then take the DFT of the windowed function $x_w[n]$:

$$X_w[k] = \mathrm{DFT}\left\{x_w[n]\right\}$$

I've read that the DTFT(Discrete-time Fourier transform) is a continuous spectrum of $x[n]$ and that the DFT of $x[n]$ (in a nutshell) is a sampling of that spectrum. When we take the $N$-point DFT of $x[n]$, we are taking $N$ samples of the DTFT of $x[n]$ where frequencies are unique (i.e., we sample within $2\pi$). That is:

\begin{align}
\mathrm{DTFT}\left\{x[n]\right\} &= X(\omega)\\
\mathrm{DFT}\left\{x[n]\right\} &= X\left(\omega = \frac{2\pi k}{N}\right) = X[k],\quad \textrm{ for } k=0,1,...,N-1.
\end{align}

My questions:

If we plot $X[k]$, we are still plotting the sample of the spectrum  against frequency, right? Is the frequency, given $k$, denoted by $2\pi k/N $ radians?
My professor asked me to plot the FFT versus $k/F_s$ where $k=0,\ldots,127$. What does $k/F_s$ represent?
A homework problem asks (given application of the 128-point Hamming window, above) to find the "continuous-time frequency spacing $\Delta F$ between DFT samples"? What does this mean? Isn't this just $2\pi/N$?

My professor told me that $2\pi/N$ is the discrete-time frequency spacing in radians and that I have to multiply that by $Fs/(2 \pi)$. I'm not sure how to make sense of $Fs/N$.


texts:
I tried to write my own circular convolution function in python using the fact that for two signals $f$ and $g$ we have

$$ \widehat{(f * g)} = f \cdot g $$

So I tried this

from scipy import array, zeros, signal
from scipy.fftpack import fft, ifft, convolve
def conv(f, g):
  # transform f and g to frequency domain
  F = fft(f)
  G = fft(g)
  # multiply entry-wise
  C = F * G
  # transfer C to time domain
  c = ifft(C)

  return c

However, for f = array([1,2,3,4]) and g = array([5,4,3,2]) I get

conv(f,g) = [ 34.+0.j  32.+0.j  34.+0.j  40.+0.j]
convolve.convolve(f,g) = [  1.48219694e-322   2.07507571e-322   3.06320700e-322   3.26083326e-322]
signal.convolve(f,g,'same') = [14 26 40 29]

The first function is mine, the second one comes from the fft pack and the third one is from the scipy signal package. All return different results. How does this happen and what is the "correct" one?

The circular convolution I want is

$$(f*g)[n] = \sum_{p=0}^{N-1} f[p]g[n-p] $$
where $f[p] = f_{p \mod N}$. Can somebody help me?

Edit: I added a direct calculation for $(f*g)$

def direct(f,g):
    r = zeros(len(f))
    for k in range(len(f)):
        for p in range(len(f)):
            r[k] = r[k] + (f[p] * g[k-p])
    return r

which returns the same result as my own implementation above. So my implementation seems correct. However, why do convolve.convolve and signal.convolve return other results?


texts: Does anyone knows can i find a FFT of 1536 length input. Its a specification given in 3gpp Lte and we need a transform of 1536 input size which is neither a power of any number i would say. I just need a theoretical idea.


texts: Finding impulse response of an RC circuit from its step response

texts:
I have to find the impulse response of an RC circuit (c up ). I have to find it from the step response $g(t)$.

I found that

$V_i - V_c - V_r = 0$ , with $V_r = V_u$

So

$V_u = V_r = R I_r$ , with $I_r = I_c$

$V_u= RC  \frac{dV_c}{dt}$

$V_u = y(t) = RC \frac{d(x(t)-y(t))}{ dt}$

because $V_c = x(t)-y(t)$

From this i found $y(t) = RC ( x'(t) - '(t) )$ , i simply rewrote d/dt with '.

Now if i want to found the step response, i considered $x(t) = u(t)$ and $y(t) = g(t)$ that is the step response

So i wrote
$$g(t) = RC u'(t) - RC g'(t)$$

but $u'(t) = 0$ so is $RC g’(t) + g(t) = 0$

Solving this differential equation i obtained that

$$g(t) = k_0 +  k_1 \cdot e^{-t/RC }$$

Until now i obtained the same results of my professor but now that i have the step response i have to find the $h(t)$, impulsive response , but I don’t know how. Can someone please help me ? This is the same problem of my previous question but in this case i have to find the impulsive response using the step response. Thank you so much


texts: Fourier transform of images and phase filters

texts:
What are the known possibilities to date for filtering the phases of an image and what are they used for?
Phases are used in some edge detection algorithms.
They are also used for cross correlation of 2 images.
Is there something more? (I'm thinking about the same principle used with the amplitudes, bandpass filtering)


texts:
I'm currently working on vibration detection machine used to detect unbalance from a rotating shaft, rotating from 300-2500 Hz. I have both the tacho signal ( 1 PPR ) and the vibration from transducer.

Now I'm really confused. After the transducer there is sweep filter that uses the tacho signal as center frequency so at 1 kHz the output sine wave is 1 kHz.

How do i extract useful data from this signal ?

I've read for the past week on the internet about order analysis and different methods but im so confused about how to implement it, how fast should the ADC sample rate be for the order tracking?

Should I do Fourier transform over the sine wave?

How to transfer the signal to angular domain?

Everything is just confusing. A little help on order analysis, or how to extract information from rotating shaft would be very appreciated!


texts: trainCascadeObjectDetector seems to be missing from MATLAB R2012b

texts: I wish to use trainCascadeObjectDetector to train on new objects (other than faces); I have the Computer Vision Toolkit installed; but this function trainCascadeObjectDetector seems to be missing from my system. Did I miss something during installation? Or has this been removed from R2012b?


texts: Is there any information we can extract from the residual

texts: The residual in estimation is the difference between the measurement and the previous estimate. My question is when I plot this quantity, what is ,if any, information I can extract or infer from this quantity? No beneficial information I can see from the figure. Any suggestions?


texts: Power Spectrum of the Current of Compact Fluorescent Lamp (CFL) Compared to the AC Input

texts:
Is it possible for an AC current (current passing from CFL) to have a harmonic component greater in magnitude than its fundamental?

In my country fundamental frequency which carries power is 50 Hz. But, when I pass this power to CFL(compact fluorescent lamp) and get the FFT of the current passing through it (through MATLAB). The spectrum shows me fundamental component(50 Hz) magnitude less than the third harmonic(150 Hz) roughly twice of the fundamental.

Hope this will clarify my question.


texts: Source Filter Modelling of Speech Production

texts: I am reading about mathematically modeling  Speech using Source- Filter model. I want to know how can we prove that that the source filter model becomes an LTI system provided the configuration of filter remains the same?


texts: Reconstructed output mismatch for LTI system

texts:
I have a system with measured input (u) and output (y).

I assume that this is an linear time-invariant (LTI) system and I want to find its impulse response (ir).

This is the Matlab code I use to find ir:

ir = real(ifft(fft(y)./fft(u)));

And this is how I reconstruct the system output:

Y = conv(ir, u);

However, as can be seen below, the reconstructed output differs greatly from the true output. What am I missing here?

The full matlab code including data can be found here


texts: Is it required to quantize wavelet coefficients before one derives features from?

texts: I am using wavelet coefficients for feature extraction in classification problem. As the wavelet coefficient values are real, positive and negative, is it required to quantize them before feature extraction?


texts:
I have a question related to wavelet transform: we know that while the Fourier transform is  good for a spectral analysis or which frequency components occurred in signal, it will not give information about at which time it happens. That's why the wavelet transform is suitable for the time-frequency analysis. It is also good for signal denoising, but of course it has some disadvantages.

So I would like to know what are main advantages of the wavelet transform? Is it good for spectral estimation; like finding amplitudes, frequencies and phases, or it just helps us to find discontinuous and irregularities of a signal?

Thanks in advance


texts: System Stability: Can we derive stability of a discrete system (Frequency domain, Z-transform) by applying analogous methods?

texts:
So given some analogue system function in the complex s-domain. Can we perform a stability analysis in the $s$-domain, before actually transfer it into the $z$-domain? So in other words analysis in the $z$-domain is not necessary anymore?

The reason why I am unsure is that we have a sample and hold element which needs to be added to our system:

$\frac{1-e^{-sT}}{s}$ which changes to $\frac{z-1}{z}$

(I did use partial fraction decomposition/method of residues and did not use any approx. like bilinear transform, impulse variance method.)


texts: Confusion about how to calculate signal to noise ratio(SNR)?

texts:
I searched a lot but I didn't find a good answer. According to wikipedia SNR page, SNR can be calculated by both ratio of Power of clean signal to its noise Power either ratio of variance of clean signal to variance of its noise, but actually power and variance are two different things so I am confused how we can use both of them equally. I should mention that I speak about two finite signal, first the original one and second the noisy one and want to calculate the SNR.
Thank you


texts: Cropping binary images based on pixel counts in python

texts:
I have a numpy binary masked image that looks like the following:

I want to automatically crop this image like the following:

Can I achieve this using some sort of image processing rather than building a bounding box regressor?
The method should also work if the image is horizontally flipped.
I am currently using th below crop function to crop the image if any row or column have all 0 pixels:
def crop_image(img,tol=0):
    # img is 2D image data
    # tol  is tolerance
    mask = img>tol
    return img[np.ix_(mask.any(1),mask.any(0))]

This crops out the upper black space from the image but does not work for the lower part for obvious reasons.
My attempt was to try to threshold the image based on pixel counts. Below is the code:
counts = np.sum(image==1,axis=0)
plt.plot(counts)

If we can threshold the image as below we might also consider the task partially successful as we would get something like the following:

Thanks alot. Any help will be highly appreciated.


texts:
TWO PART QUESTION - We've all seen the movies/TV shows where the police/feds/spies use computer software to take a grainy photo and do a "clean-up" to see a better picture and more details. I assume the concept is executed by some sort of uber-power pixel-smoothing or anti-aliasing type of algorithms to fill in the blanks based on deductive processing.

PART 1: How real is this technology in the public/commercial software world? I'm not asking about any speculation on alleged secret gov software or such, I just want to know where we actually are with this concept today? How much is fully automated vs human-assisted.

PART 2: Assuming there actually is some reality with this technology for photographs the second part of this question is how (if at all) has this been applied to videos? Again the issue of fully automated vs human assisted is of interest here.

At the heart of this post is the ultimate question of how viable is today's software for being able to take an old VHS or DVD recording and process the frames to create a new HD-resolution remaster. Considering that doing this would mean cleaning up tens-of-thousands of frames for even a simple wedding video I am not expecting this technology to be fast of course.

NOTE: Per in-topic and meta discussions I went ahead and cross-posted this in two other suggested SE forums to acquire their viewpoints and expertise on this matter. So far (it is still a little "early in the day" so to speak) I have received some pretty interesting information in 2 of the 3.

When this is all done (when good answers have been selected) I would appreciate a way to merge these for the benefit of all three SE communities:

Computer Graphics: https://computergraphics.stackexchange.com/questions/1880
Signal Processing: What is the state-of-the-art of using signal-processing for "cleaning-up" videos?
Video Production: https://video.stackexchange.com/questions/17363


texts: Why doesn't sampling a periodic continuous-time signal yield a periodic discrete-time signal?

texts:
I have been studying signals and systems lately and I have came across the following claim:

  The uniform sampling of a periodic continuous-time signal may not be periodic!

Can someone please explain why this statement is true?


texts:
I took a z transform and got a double pole at $z=1$, but I don't know if that's correct.

I'm  lost because I don't know if $\cos(\theta)$ converges or diverges or what that means for $h[n]$ being absolutely summable.


texts:
Creating a noise cancelling earphones that cancel/suppress speech is a huge challenge , maybe even impossible.

But what happens if we change the goals a bit:

We need to cancel the noise(music,speech) coming from a tv in the same room.
We can receive what audio the tv will create , some time before it's created through the speaker.

Does it make it possible to create great noise cancellation ? how would it work ?


texts: How is Bayesian Estimation related to filtering?

texts:
I am reading about estimation theory, including topics like Bayesian Estimation (e.g. Wiener Filtering).

It seems that we usually define a filter in terms of tis frequency response (e.g. High Pass, Low Pass). On the other hand, Wiener Filter works by filtering out noise without specific reference to frequency domain.

How are the two related? If not, are they just two different approaches to the filtering problem?


texts: Identifying & Measuring a Signal in Noise

texts:
I am searching for the signal circled in green in the 2.4GHz range. The sampling rate in this image is 800kHz, my setup is this power meter hooked up to an oscilloscope.

The three troughs are always the same time away from each other, but their amplitude (which I want to measure) changes. How can I detect this signal and measure its amplitude when the amplitude is lower than the amplitude of the other things going on in this frequency band that I don't care about (in red)?

I am a beginner to signal processing using Matlab. Any suggestions would be appreciated no matter how obvious they may seem to you :)


texts: How to get the DCT energy distribution image in MATLAB,or we may call it the DCT coefficients distribution image?

texts:
The picture below is drawn by the DCT coefficients after making DCT to an image :

I want to get an image like the picture above. Here are some problems:

Should I do the DCT to the whole image instead of using the block DCT? And what MATLAB function should I use?
How to deal with the coefficients? Make it in the range of $[0, 255]$? Or make the coefficients matrix to be a Binary Image?

I would really appreciate if someone can help me!


texts: How are phase values able to capture motion from video?

texts:
I know that the phase spectrum contains most of the structural information about the image
importance of phase. But I want to know more about importance of phase spectrum related to video signals.

I have read that temporal variations of phase values are able to capture most of the dynamical characteristics of the video sequence like global motion in the video phase based modelling, but I don't understand how it does?

Please consider any real time example say video of rotating wheel or wave (or video of traffic on road) if I compute its phase spectrum using Fourier Transform, the phase values captures motion of rotating wheel (or complex motion of moving car on road), but I don't understand how it does? By which property of Fourier transform could anybody can explain it to me?

Also can anybody explain the mathematical relation between motion and phase? Please correct  if I am getting wrong.


texts: Find transfer function from root locus and step response diagram?

texts:
I am given the response of a step of magnitude of 3 and the root locus and I have to find the transfer function of the system. The function I find gives me the step response(magnitude of 3 again) of the last diagram.

I'm a beginner at this so I've done something stupid probably but I have trouble finding answers regarding control engineering on the internet. This is what I tried doing:
I found the poles and the zeros from the root locus. $z=-5,+4, p=-6,-10,-3$. I think my transfer function is given from this formula but I'm not sure if we have an $H(s)$ in the feedback and it is not stated : $$ T(s)=  \frac{KG(s)}{1+KG(s)} $$
From the poles and the zeros my open-loop transfer function $G(s)$ is :
$$ G(s)= \frac{(s+5)(s-4)}{(s+10)(s+6)(s+3)}$$ Doing the calculations I find : $$ T(s)= \frac{Ks^2+Ks-20K}{s^3+(K+19)s^2+(108+K)+180-20K}$$
From the step response(final value is 4) and the final value theorem I find $\frac{-20K}{180-20K}=-4/3\implies K=5.14$.  I divided 4 by 3 because of the step magnitude. With this K the step response is the one in the third diagram.It's close to the first one but it's not the one I'm looking for.

What am I missing here?


texts: Low pass filter with different non linear phases

texts: I want to design low pass filters with different non linear phases. Means the magnitude response of all low pass filters will be same but having different non linear phases.


texts: Is there anything called uncorrelated filter?

texts: I understand to an extent various filter like low pass filter, high pass filer, Wiener  filter Kalman filter etc. I also understand some of this filter will decorrelate/uncorrelate the signal. The question is: is there any filter which does nothing but uncorrelated a signal? What I mean by decorrelate is the following. Consider $x$ is the signal and we apply a filter $w$ to $x$, after the operation we get say $y$ now, I want $y$ to have zero auto-correlation for say $n$ number of samples, preserving the edges as surely those would form correlated section. An obvious answer (as pointed out in comment) of 0 as $w$ is not considered interesting.


texts: Defining bound on input signal to test accumulator for BIBO stability

texts: For an accumulator, defined as shown in the image below, why would I define $B_x=1$? $u[n]$ is defined at zero so my (possibly misguided intuition) is telling me that I'd choose $B_x = 0$ to not eliminate that point.


texts: How to calculate the instantaneous frequency of a signal?

texts: I am trying to do the complex trace analysis of a seismic trace in Matlab where I need to calculate the instantaneous frequency of a discrete signal. I have used the formula according to Barnes. I am running an algorithm where I need to iteratively run complex trace analysis on the residual trace obtained after subtracting a matching wavelet from this trace. Though the formula gives me the results for lower frequencies <50 Hz, it does not give the right results for >60 Hz. I am not able to understand why this is happening. Can someone please tell me the reason behind this and how to do this correctly?


texts: Filtering out symmetric noise from an oscilloscope reading

texts:
I have a signal that looks like this:
The data is readings from two oscilloscope channels, one color coded blue, the other color coded orange. I would like to filter out the supply noise (all the junk scattered around 0) in both channels to be better able to detect spikes that might occur at and after t=0.
The data files consist of ~25k points. I'm using scipy. The initial peak is always centered roughly on t=0.
My first thought is that the noise is generally symmetric, so I could add the bottom half to the top half to flatten things out. However, the points are discrete, so I think I need to smooth/shift the data somehow to get cancellation. Since the pulses are not symmetric, they should be attenuated only slightly.
I also thought about taking a bunch of small averages the width of a typical peak, but I'm not sure which method will be the most robust.
I don't have much experience, and would like to see if there's an altogether better method I should implement.
Thank you!
Edit:
A fft of the voltage data:


texts: What does $I_{seg}$ in 3GPP TS 38.212 version 15.2.0 Release 15 represents?

texts:
I'm working on 5G NR, whereby on reading Code block segmentation and code block CRC attachment given in Subclause 5.2.1 of 3GPP TS 38.212 version 15.2.0 Release 15.

What does $I_{seg}$ represent?