Determine frequency of signals
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi, how do I determine the frequency of this signal?
I got this from a .mat file
x = load('signal1.mat');
plot(x.x);
Antworten (1)
Chunru
am 14 Jan. 2022
load signal1
fs = 1; % normalized freq
y = abs(fft(x));
L = length(y);
f = (0:round(L/2)-1)/L*fs;
p = y(1:round(L/2));
[pmax, imax] = max(p);
plot(f, p, 'b-', f(imax), pmax, 'r*')
fprintf('The freq: %f\n', f(imax))
0 Kommentare
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!