spectrum analysis of wind

Hello every one.
I am having Wind hourly data. Now I want to know spectral analysis of wind for cycles/day..
could any one help me out.. It would be better appreciation.
Thanks in advance.. phanindra

 Accepted Answer

Wayne King
Wayne King on 18 Nov 2013
Edited: Wayne King on 18 Nov 2013
If you have the Signal Processing Toolbox, you can use periodogram() to get a power spectral density estimate of the wind data in cycles/day. periodogram() is nice because it will output an appropriate frequency vector for you and confidence intervals if you desire.
I'll show you how to do that with your sampling frequency, 1 sample/hour. I'll have to simulate some data because you did not attach yours.
30 days of data:
t = 0:1:(30*24)-1;
x = 1.5*cos(2*pi*(1/24)*t)+randn(size(t)); % 1 cycle per days plus noise
[Pxx,F] = periodogram(x,rectwin(length(x)),length(x),1);
plot(F*24,10*log10(Pxx))
xlabel('Cycles/Day'); ylabel('dB');
Otherwise, you can use fft() in base MATLAB, to the same in base MATLAB, see

1 Comment

reddy
reddy on 18 Nov 2013
Edited: reddy on 18 Nov 2013
hello Wayne King..
Thank you for your reply. I am having data starting from odd hours and ends at odd hours. any ways I will choose from 00 hours only.
And I did understand still could you please let me know how to handle this data set which i am attaching
thanks in advance..

Sign in to comment.

More Answers (2)

Wayne King
Wayne King on 18 Nov 2013
Edited: Wayne King on 18 Nov 2013
You don't really have a lot of data here. If you just choose from 0:00 you only have 42 samples.
Even taking all the data, I don't see a strong periodicity here. You have a non-zero mean (DC component). If you remove that, there is some oscillation around 0.015 cycles/hour or 0.36 cycles/day, but your frequency resolution is just 1/55, so I wouldn't feel too confident about that (given that you had a non-zero mean). Bottom line, you need more data.
[data,txt] = xlsread('Book1.xlsx');
[Pxx,F] = periodogram(data-mean(data),[],256,1,'centered');
plot(F,Pxx)
xlabel('Cycles/hour')

4 Comments

hey Wayne King
Okay I am attaching the entire data so you please tell me how to handle this data..
[data,txt] = xlsread('Book1.xlsx'); [Pxx,F] = periodogram(data-mean(data),[],256,1,'centered'); plot(F,Pxx) xlabel('Cycles/hour')
When I am using the above code what you have given I am getting error like
[data txt] = xlsread('wind.xlsx');
[Pxx,F] = periodogram(data-mean(data),[],256,1,'centered'); Error using periodogram (line 110) Ambiguous or invalid string option specified.
help me out
thank you in advance
Wayne King
Wayne King on 18 Nov 2013
Edited: Wayne King on 18 Nov 2013
which version of MATLAB are you using, you must have an older version.
plus you have 87 NaNs in your data, what do you propose to do about those?
Hi Wayne king
I can not change those NaN values. I want to leave those NaN fields like that only.. And I am having 2011 Matlab.. I have 2009 also but I am not using it..
So what do you suggest Mr.Wayne King.
reddy
reddy on 25 Nov 2013
Edited: reddy on 25 Nov 2013
hi Wayne King one more help
I got the plots with your earlier suggestions.. Thank you for that. and now you look into the attached
figures and let me know how to get the same spectral analysis plots.
Thanks in advance.

Sign in to comment.

Asked:

on 18 Nov 2013

Edited:

on 25 Nov 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!