i have a signal with many frequencies. how to find this frequencies and reconstruct the signal from these frequencies
Show older comments
I've attached a MATLAB code, in that timeseries is the signal for which frequencies have to be found. I've tried using FFT but not getting the answer. my code for frequency and regeneration: t =0:1:2048; y=timeseries;
ffty = fft(y);
ffty = abs(ffty(1:ceil(length(y)/2))); % ffty(ffty<2)=0; [~,locs] = findpeaks(ffty); freqs = (locs-1)/t(end); signal_1=0; for n=1:1:length(freqs) signal_1 = (signal_1+sin(2*pi*freqs(n)*t)); end hold on plot(smooth(signal_1));
hold on plot(y,'b');
Accepted Answer
More Answers (0)
Categories
Find more on Get Started with Signal Processing Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!