I'm trying to do some calculations on a signal. The signal is supposed to be a measured reading from a rfid tag modulated by a block wave around 40 kHz on a carrier wave of 868 MHz. The signal I have is sampled at 250 MHz giving me 1250005 samples that are stored in this .mat file.
Now I would like to plot the spectrum x[n]. What I'm told to do is do a fft on it of a segment of 1024 samples. Or use Matlabs PSD function. But I'm struggling with this. This is my Matlab code so far:
load antenna_1;
x = channel_1;
Fs = 250e6; % Sampling frequency
t = (0:length(channel_1)-1)*1/Fs; % Time vector
nfft = 1024; % Length of FFT
X = fft(x,nfft);
X = X(1:nfft/2);
mx = abs(X);
f = (0:nfft/2-1)*Fs/nfft; % Frequency vector
plot(t,x);
xlabel('Time (s)'); ylabel('Amplitude');
figure(2);
plot(f,mx);
xlabel('Frequency (Hz)'); ylabel('Power');
This last plot shows me one frequency component around 119 MHZ. Now that's not completely weird because of the aliasing from the 868 MHz signal 868 - 3*250 = 118. But I'm still not quite sure if this is indeed the correct spectrum of my signal? And how would I use the psd function to get the spectrum?
psd
function is deprecated, you are supposed to usepwelch
instead, which is in the signal-analysis toolbox. For correctly estimating the spectrum of a measured signal, this function is much better than doing some FFTs by hand. – Bas Swinckels