-1

I need help with implementing FFT in hamming window to search peak on the graph/chart (determination of the spectral phase function). At this moment I know how to mark all the peaks on my chart, and also how to load all the file from folder on one chart. And now the most important thing is to find a peak by FFT hamming window. For now the most important thing for me is just to implement this to my script or show me how to do this. When I understand this, I can modify it to search for the peak I want.

My code:

folder = 'C:\Users\an\Desktop\Materialy\';

files = dir(fullfile(folder,'*.dat'));
files_len = numel(files);

if (files_len == 0)
return;
end

figure(1);

file = fullfile(folder,files(1).name);
[lam,I] = read_spectrum(file);
lam = lam * 1e-3;
plot(lam,I);

if (files_len > 1)
hold on;

for i = 2:files_len
    file = fullfile(folder,files(i).name);
    [lam,I] = read_spectrum(file);
    lam = lam * 1e-3;
    plot(lam,I);
end

hold off;
end
jsanalytics
  • 13,058
  • 4
  • 22
  • 43
Maciej
  • 3
  • 6

1 Answers1

0

Steps for you:

calculate Hamming window weights for your array size

multiply data by Hamming weights

make FFT

In general-purpose language I use HW in such way (N is array size):

  Re[i] := Re[i] * (0.54-0.46*cos(2*Pi*i/N));

But seems that in Matlab you have ready function

MBo
  • 77,366
  • 5
  • 53
  • 86
  • So, it's will search the peak which i want ?, can you show me a example code to this how it works etc ? – Maciej Nov 22 '17 at 08:06
  • Neither Hamming weighting nor FFT don't search peaks. They are just instruments to transform data. You would formulate real problem and perhaps show desired result – MBo Nov 22 '17 at 08:12
  • Okej, but od You use the fft to filter the graph You can search the peaks yes ? And for now my problem is how to implemennt the fft to my code , or i'm wrong thinking and it's not working ? – Maciej Nov 22 '17 at 13:03
  • My problem is about search peak from all peaks on the graph ( file with date from interpherogrph) the peak with i search is lambda 0 – Maciej Nov 22 '17 at 13:20