Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Mathematics
General TopicsResearchOperations ResearchStatisticsMathematical LogicNumerical AnalysisUndergraduate MathAlgebra HelpRecreational Math
Math Software
MapleMathematicaMATLABScilabSASSPSS

Math Forum / Math Software / MATLAB / October 2008



Tip: Looking for answers? Try searching our database.

creating frequency vector

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ekong nathaniel - 31 Oct 2008 18:50 GMT
u=[5.65657
4.09474
2.98886
3.74147
1.39051
3.1138
6.2747
5.87201
3.29907
4.17219
4.44912
4.73424
3.78176
2.83575
3.34117
3.95901
1.97765
1.91652
2.00037
4.24108
4.9018
3.91039
-0.170792
0.725255
0.490314
4.09817
5.52631
5.87125
3.57782
1.78822
5.50149
6.86609
6.101
5.64888
5.42735
8.4681
5.88525
9.69079
6.82079
4.64868
1.27876];
I am not so familiar with Matlab. The examples I have looked at arevery easy to follow but the application has been so difficult .

These data samples were taken after 3 sec, so I considerl the time interval, h between each sample as 3 sec.

Therefore,
Fs=1/h=1/3=0.3333Hz % sampling frequency
N=1199 % length of signal (total length at 60minutes)
w=fft(u);
subplot(2,1,1)
plot(u);

f=Fs/2*(0:L-1)/L;
subplot(2,1,2)
plot(f,abs(w(0:0.5*L)))

The spectral analysis of this is not giving clear frequency of the signal and I worry if the frequency vector I created is wrong.

Can anyone look into this for me?
Rune Allnor - 31 Oct 2008 19:57 GMT
> I am not so familiar with Matlab. The examples I have looked at arevery easy to follow but the application has been so difficult .
>
> These data samples were taken after 3 sec, so I considerl the time interval, h between each sample as 3 sec.

> The spectral analysis of this is not giving clear frequency of the signal and I worry if the frequency vector I created is wrong.
>
> Can anyone look into this for me?

First, never start with measured data. Start with simulated
data where you know the exactl parameters (sampling frequency,
signal frequency, signal amplitude). Then do the analyis with
the simulated data and see if you can extract the parameetrs
from the analysis results.

Once you are happy that you understand what is going on (get the
frequency axis right, understand how the amplitude axis behaves)
then try with the measured data.

Lots of work, but this is the only way that gets you to a result.
The code you already have is a long way in the right direction,
there might be one or two details missing. Just repeat the analysis
with signals of known parameters and try and understand what is
going on.

Rune
ekong nathaniel - 31 Oct 2008 20:27 GMT
> > I am not so familiar with Matlab. The examples I have looked at arevery easy to follow but the application has been so difficult .
> >
[quoted text clipped - 21 lines]
>
> Rune

Thanks Rune. Though I have done what you have suggested, I will try again.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.