COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### Hamming Window after Fourier Transform

• Email
• 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

See related articles to this posting

"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

1 Replies
741 Views

Similar Articles

12/7/2013 7:18:02 AM
page loaded in 77765 ms. (0)

Similar Artilces:

after stitching
1st problem: How to apply loop in this code, condition is :if correlation is maximum then transformation and stitching is done automatically with code . another problem : when i stitched the two images. It show the both images on overlapping point. please reply as soon as possible. because my presentation is coming on next week. I1=im2double(imread('C:\Users\KARAN\Desktop\image002.jpg'));%main image 1 imshow(I1); % round and crop once again so that no error should be there [I2 rect] =imcrop(I1); rect=round(rect) I2=imcrop(I1,rect); sI2=size(I2); figure,imshow(I2) impixelinfo I3=im

Uninstall CS2 after after installing CS3?
Can I simply uninstall CS2 after installing CS3 or do they share files? "Michael Duerr" <mduerr@web.de> wrote in message news:f09ohb$gfg$1@localhost.localdomain... > Can I simply uninstall CS2 after installing CS3 or do they share files? AFAIK CS2 and CS3 may be installed or uninstalled independently. -- Mike Russell www.curvemeister.com/forum/ In a word YES. In article <f09ohb$gfg$1@localhost.localdomain>, mduerr@web.de says... > >Can I simply uninstall CS2 after installing CS3 or do they >share files? As far as the shared files aspect, I think that you have gotten your answer. One thing that you might want to do is De-Activate your CS2, prior to removing it. In the old days, I always kept an older version of PS on my computer, just for backups. Though I do not recall any problem with an Activated copy of CS and CS2 on the same box, I'm not sure how this aspect will play out with CS3 and future versions. If I were going to remove it, I'd De-Activate first. Hunt

After adding memory on a server...
Hi, We having problem on a Oracle 8.1.7 server (unable to allocate memory)... I see that I reach all of the memory on the server (2Go). I add memory on the server, my server have now 4Go of RAM. But we have the same error message and the RAM did not takes over the 2Go. We have parameters to adjust after adding memory? Does Oracle allocate the PGA with the unused memory on the server? Thanks. <mtn_bikers@msn.com> wrote in message news:1176220359.618056.83760@q75g2000hsh.googlegroups.com... > Hi, > > We having problem on a Oracle 8.1.7 server (unable to allocate > memory)... I see that I reach all of the memory on the server (2Go). > I add memory on the server, my server have now 4Go of RAM. But we > have the same error message and the RAM did not takes over the 2Go. > > We have parameters to adjust after adding memory? Does Oracle > allocate the PGA with the unused memory on the server? > > Thanks. > 32-bit or 64-bit ? What is the exact error message ? You probably need to increase the shared pool, not the buffer cache. On Tue, 10 Apr 2007 08:52:39 -0700, mtn_bikers@msn.com wrote: > We have parameters to adjust after

object instance after if isalpha()
Hi I'm still learning python and I've been loving it, but, that's not the reason I'm writing. I'm trying to create an object only if a variable is alpha and see what I get. $cat 1.py class abc: def __init__(self): name='marcelo' a='STRING' print a.isalpha() if a.isalpha(): x=abc() print 'was x created?:', x,'\n' print x.name$ python 1.py True was x created?: <__main__.abc instance at 0x186b9e6c> Traceback (most recent call last): File "1.py", line 12, in ? print x.name AttributeError: abc instance has

SCL control after %filesrv