1
$\begingroup$

I'm experimenting with FFT simulations. I'm generating transient data at the some sampling rate, down-sampling this (mimicking a device's behavior) to 2048 points. Then take the FFT using Fourier[Data,FourierParamters->{-1, -1}]. However I realise I need to apply an anti-aliasing filter to the transient signal to remove higher frequency components that violate the Shanning-Nyquist theorem. Does anyone know of an approach to implement this in Mathematica?

Here is my sample code

TransientSignal[A_, ω_, t_] := A Cos[ω t]

A0 = 0.4;
ν0 = 21.;
ω0 = 2. π ν0; 
C0 = 0;


Sr = 262100;
dt = 1. / Sr;

FFTSpan = 50;
FFTLines = 800.;
FFTSamples = 2048;
FFTCentre = 24000.;

Δf = FFTSpan / FFTLines;
τAvg = 1. / Δf;

TransPts = τAvg / dt;

DownSample = Round[128/FFTSpan FFTLines];



TransientSignalData = TransientSignal[A0, ω0, Subdivide[0., τAvg, TransPts - 1]];
    DownSampledData = Downsample[TransientSignalData + TransientNoise * 0, DownSample];

FFT = Fourier[DownSampledData,FourierParameters->{-1, -1}];
Freq = Table[i Δf, {i, 0, FFTSamples - 1}];
    AbsFFTwithFreqs = Transpose[{Freq, 2. Abs[FFT]}];

ListLinePlot[AbsFFTwithFreqs,PlotRange->All,Frame->True,FrameLabel->{{"AMPLITUDE ARB UNITS",""},{"FREQ. HZ",""}},ImageSize->500]

The reason I think I need this filter is that, if one keeps increasing the frequency, ν0, of the input transient signal you notice that the two peaks of the resultant FFT converge and wrap around cyclically as ν0 is increased. This doesn't make sense as once ν0 moves out of the frequency span I shouldn't see any peak features because of Shanning-Nyquist. So I need an AA filter to remove these higher terms for things to make sense.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.