|
Getting Started with IDL: Signal Processing with IDL |
|
Perhaps a better way to eliminate noise in the NOISY dataset is to use Fourier transform filtering techniques. Noise is basically unwanted high-frequency content in sampled data. Applying a lowpass filter to the noisy data allows low-frequency components to remain unchanged while high-frequencies are smoothed or attenuated. Construct a filter function by entering the following step-by-step commands:
Y=[FINDGEN(100),FINDGEN(100)-100]
Y[101:199]=REVERSE(Y[0:98])
filter=1.0/(1+(Y/40)^10)
IPLOT,FILTER
To filter data in the frequency domain, we multiply the Fourier transform of the data by the frequency response of a filter and then apply an inverse Fourier transform to return the data to the spatial domain.
NOISY dataset and store the filtered data in the variable lowpass by entering:LOWPASS=FFT(FFT(NOISY,1)*filter,-1)
| Note Your plots may look slightly different due to the random number generator. |