Hello all
I am trying to understand the code for the matlab function called "prettyFFT" provided at
https://secure.engr.oregonstate.edu/wiki/ams/index.php/Matlab/PrettyFFT
Can anybody help me understand the section of the code given below:
Code dot - [expand] |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
| % GET HARMONICS
harm = bin;
t=1;
nyqpts=(pts/2-1);
all_harms = harm:step:(harm*nyqpts);
all_harms = mod(all_harms,pts);
all_harms = (pts-all_harms).*(all_harms>nyqpts) + all_harms.*(all_harms<=nyqpts);
all_harms = all_harms.*(all_harms>0 & all_harms<pts/2) + (all_harms<=0) + (all_harms>=pts/2).*nyqpts;
if (maxh==0 || maxh>length(all_harms))
maxh=length(all_harms);
end
for k=1:maxh
if(dbf2(all_harms(k)) > noise_top)
harm(t) = all_harms(k);
hnum(t) = k;
t=t+1;
end
end |
Last edited by a moderator: