Filtering Frequency Domain Noise
Introduction
This application filters out certain frequencies from the frequency domain representation of an experimental data set.
restart
with⁡SignalProcessing:withplots:
Experimental Data
This data table contains 1024 experimental data points, assigned to the variable 'data'.
From the following plot, there appears to be an underlying trend in the data.
OriginalDataPlot≔SignalPlotdata, samplerate=1,color=gray, labeldirections=horizontal,vertical: displayOriginalDataPlot;
Frequency Domain Representation
If the data is examined in the frequency domain, the resulting power spectrum shows two dominant frequencies, as well as many low power frequencies.
data_fft:=FFT⁡data:
data_fft_ps≔sqrt~PowerSpectrum⁡data_fft:
SignalPlotdata_fft_ps1..10242, samplerate=1024, axis1=mode=log, title=Power Spectrum,labels=Frequency (Hz),Power
Filtering Noise in the Frequency Domain
Frequencies below a specific threshold can be removed with a custom filter. The Explore command can be used to show how the changing the frequency option of the low pass filter changes the resulting filtered signal.
F ≔ procdataset, lp local filteredData,filteredDataPlot,powspFilteredData,taps; taps ≔ GenerateFiniteImpulseResponseFilterTaps20,lp,':-filtertype'=lowpass; filteredData ≔ FiniteImpulseResponseFilterdataset,taps; filteredDataPlot≔SignalPlotfilteredData, samplerate=1, title=Filtered Signal,view=mindataset..maxdataset: powspFilteredData≔SignalPlotsqrt~ PowerSpectrumFFTfilteredData1..10242, samplerate=1024, axis1=mode=log,title=Filtered Power Spectrum, labels=Frequency (Hz),Power; displayArrayOriginalDataPlot,filteredDataPlot,powspFilteredData,size=1.0,600;end proc:Explore F data, 0.5−f , parameters=f=0.001..0.495,label=0.5 − frequency, size=1000,600 ;
Comparison of Original and Filtered Data Set
By comparing the original signal plot with the filtered data, the underlying trend is more clearly visible.
filteredData ≔ FiniteImpulseResponseFilterdata,GenerateFiniteImpulseResponseFilterTaps20,0.13,':-filtertype'=lowpass:
filteredDataPlot ≔ SignalPlotfilteredData, view=mindata..maxdata:display⁡OriginalDataPlot,filteredDataPlot
Download Help Document