Digital communications and MATLAB. Modify the given
the below code to satisfy the given task in the
bottom:
Matlab Implementation:
Estimate the one-sided power spectral density of a noisy
sinusoidal signal with two frequency components at 1.5 kHz and 10 kHz
with a sampling frequency of 32 kHz.
Fs = 32e3;
t = 0:1/Fs:2.96;
x = cos(2*pi*t*1.5e3)+ cos(2*pi*t*10e3)+ randn(size(t));
n = length(x);
nfft = 2^nextpow2(length(x));
Pxx = abs(fft(x,nfft)).^2/length(x)/Fs;
Store the spectrum in a PSD data object and plot the
result.
Hpsd = dspdata.psd(Pxx(1:length(Pxx)/2),'Fs',Fs);
plot(Hpsd)
Create a two-sided spectrum and plot it.
Hpsd = dspdata.psd(Pxx,'Fs',Fs,'SpectrumType','twosided');
plot(Hpsd)
Redo the above example using periodogram().
It is easiest to use periodogram() in Signal Processing
Toolbox. It can handle all the scaling for you.
Fs = 32e3;
t = 0:1/Fs:2.96;
x = cos(2*pi*t*1.5e3)+ cos(2*pi*t*10e3)+ randn(size(t));
[Pxx,F] = periodogram(x,[],length(x),Fs);
plot(F,10*log10(Pxx)); grid minor
title('Spectrum of a noisy signal');
xlabel('Frequency (Hz)');
ylabel('Magnitude (dB)');
Task 1 (5 marks):
Estimate the power spectral density of the following signal
using periodogram() and pwelch():
x(t) = 5 sin(2*pi*f1*t/fs) + 2 sin(2*pi*f2*t/fs) + Uniformly Distributed Random noise
f1 = 120 Hz, f2 = 60 Hz, and fs = 1 kHz
Show all the Matlab codes and the graphs for each case