erfanzabeh/WaveMonk

Bugs in FindPhaseCoeff.m

Opened this issue · 0 comments

In FindPhaseCoeff.m:

...
pk = findpeaks(phase_interval,2*pi*(0.9));
K = zeros(numel(timesample),1);
for k = 1:numel(pk.loc)
    K = K+(timesample-pk.loc(k)>0)';
end
...
  1. The second argument in findpeaks takes the sampling rate. What's 2*pi*(0.9) doing here?
  2. pk is NOT a structure to have any loc attribute but a vector! So, rewrite as:
[~, loc] = findpeaks(phase_interval);
K = zeros(numel(timesample),1);
for k = 1:numel(loc)
    K = K + (timesample - loc(k) > 0)';
end