Clear Filters
Clear Filters

How can I find the carrier frequency and sidelobe frequencies from the following data that i collected on Matlab

23 views (last 30 days)
I've collected data from a wav file in matlab in the time domain and frequency domain but I'm not sure how to find the carrier frequency or sidelobes frequency from the data or if there is a piece of a code that does this for me ( couldn't find any code like this on google)
The reults ive collected are below:
The last image is frequency domain (amp vs frequency)

Answers (1)

Star Strider
Star Strider on 25 Dec 2021
The link shows only the plots.
This applies to the second plot (of the one-sided Fourier transform of the signal).
First increase the frequency resolution of the fft call that created that plot by zero-padding it using:
NFFT = 2^(nextpow2(L)+2);
and then include the ‘NFFT’ value in the fft call. The frequency vector will need to reflect that, my usual approach being:
Fv = linspace(0, 1, NFFT/2+1)*Fn; % Frequency Vector For Frequency Domain Plot
Iv = 1:numel(Fv); % Index Vector
where ‘Fn’ is the Nyquist frequency for the signal, and ‘Iv’ indexes the fft results appropraitely.
Second use xlim to isolate the x-axis between 3.5 and 5.5 kHz to see the detail. The findpeaks function (on the same signal as being plotted) can be helpful in determining the indices of the peaks, and from them, the frequencies and amplitudes.
The frequency resolution of the fft is important, so increase ‘NFFT’ in powers-of-2 (for efficiency) untli the plot demonstrates adequate separation of the carrier and sidelobes.
.
  2 Comments
Samuel Pappalardo
Samuel Pappalardo on 25 Dec 2021
How can I impliment this on the code
so far i got
%Task 1
[y,fs] = audioread('Samuel_Pappalardo.wav')
t = (0:size(y,1)-1)/fs;
figure;
plot(t, y);
title ('Time Domain')
xlabel ('Time')
ylabel ('Amplitude')
grid on
pspectrum (y,fs)
% frequency domain
nfft = 1024;
f = linspace(0,fs,nfft);
y = abs(fft(y,nfft));
figure;
plot(f(1:nfft), y(1:nfft));

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!