Hamming Window after Fourier Transform

  • Follow


Can somebody explain to a MatLab novice how to apply a Hamming window or similar filter to the frequency output from a fourier transform?

I have examined wind data, to search for periodicity in the wind speed records, and have shown a strong signal at 0.0417 - i.e. 24 hours. I want to filter out everything else so that I can bring this signal it back into the time domain. So far, the reading I have done suggests that I use a Hamming window or similar filter, but I can't find any clear instructions as to how to apply this window to my frequency domain.

The m-file that I have generated so far is attached below for information:


TimeSeries = WINDSPEED;
fftTimeSeriesShift = fft(TimeSeries);
dt = 0.25;
N = length(TimeSeries);
df = 1 / (N * dt);

t = 0 : dt : dt*(N-1);
f = df * (-N/2) : df : df * (N/2-1);

fftTimeSeries = fftshift( fftTimeSeriesShift );

figure(1)
subplot(2,1,1) 
plot(t,TimeSeries)
xlabel('Time (hours)')
ylabel('Wind speed (m s^-^1)') 

subplot(2,1,2) 
semilogx(f,abs(fftTimeSeries))
xlabel('Frequency (per hour)')
ylabel('Spectral Density')

Any help would be very highly appreciated!!!

Thank you.
0
Reply D 10/28/2010 10:49:04 AM

"D S" <dominicskinner@hotmail.com> wrote in message <iabkf0$iao$1@fred.mathworks.com>...
> Can somebody explain to a MatLab novice how to apply a Hamming window or similar filter to the frequency output from a fourier transform?
> 
> I have examined wind data, to search for periodicity in the wind speed records, and have shown a strong signal at 0.0417 - i.e. 24 hours. I want to filter out everything else so that I can bring this signal it back into the time domain. So far, the reading I have done suggests that I use a Hamming window or similar filter, but I can't find any clear instructions as to how to apply this window to my frequency domain.
> 
> The m-file that I have generated so far is attached below for information:
> 
> 
> TimeSeries = WINDSPEED;
> fftTimeSeriesShift = fft(TimeSeries);
> dt = 0.25;
> N = length(TimeSeries);
> df = 1 / (N * dt);
> 
> t = 0 : dt : dt*(N-1);
> f = df * (-N/2) : df : df * (N/2-1);
> 
> fftTimeSeries = fftshift( fftTimeSeriesShift );
> 
> figure(1)
> subplot(2,1,1) 
> plot(t,TimeSeries)
> xlabel('Time (hours)')
> ylabel('Wind speed (m s^-^1)') 
> 
> subplot(2,1,2) 
> semilogx(f,abs(fftTimeSeries))
> xlabel('Frequency (per hour)')
> ylabel('Spectral Density')
> 
> Any help would be very highly appreciated!!!
> 
> Thank you.

Hi DS, Can you clarify your application? You have identified a strong periodicity using the Fourier transform. Do you now want an estimate of the amplitude and phase of that periodicity?

If that is your application, then I don't think you want to simply filter the data. I think you want to use something like least-squares to estimate the amplitude and phase of the component. 

Write back if this is indeed your interest and I can show you how to do that. 

Wayne
0
Reply Wayne 10/29/2010 10:23:05 AM


1 Replies
597 Views

(page loaded in 0.045 seconds)

Similiar Articles:













7/22/2012 4:58:43 AM


Reply: