What does 0:79 mean in the frequency vector freq=(0:79)/(2*n*dt)?

Join the discussion
Registration is free. Start your own thread to ask a follow-up.
5 replies · 4K views
babistopher
Messages
15
Reaction score
0
Hi,

I am pretty new to Matlab and am trying to reduce the noise of a particular signal. I found this pdf online and found it to be helpful. However, I am having trouble figuring out what the freq=(0:79)/(2*n*dt) means. More specifically the 0:79 bit. Any help would be much appreciated.

Referring to: http://www.math.uic.edu/~jan/mcs320s07/matlec7.pdf
 
Physics news on Phys.org
(0:79) defines a string of the numbers from 0 to 79. The line defines "freq" as these numbers divided by the denominator.
 
Thanks for the reply. I apologize that my question wasn't clear. I meant why are they choosing 80 samples?
 
I think it's just a choice of convenience. If you plotted all 401 points in the spectrum, the peaks at bins 2 and 4 would be indistinguishable from the y axis. He's just zooming in on the region of interest.
 
Hi, jus came across this thresd, noticed your MATLAB lecture notes seems very handy. I'm wondering if I would be able to get my hands on the set of notes your using. Wil be much apreciated if so. Thanks.