The analog signal we have is st 1sin300pitcos200pit 1 Gener
The analog signal we have is: s(t) = 1+sin(300*pi*t)+cos(200*pi*t).
1. Generate the signal s(t) in Matlab
2. Find the bandwidth of s(t). Sample s(t) at twice the Nyquist rate and obtain a discrete-time sequence {s(k)}
I need help with the code for Matlab, and some explaination on it
Solution
tf=0.05;
t=0:0.00005:tf;
xt=1+sin(300*pi*t)+cos(200*pi*t);
subplot(2,1,1);
plot(t,xt);
title(\' continuous plot of the signal\');
% Nyquist sampling when sampling frequency fs=2f , f the highest frequency component in the signal
fs=2*150;
n1=0:1/n1:tf;
xn=1+sin(300*pi*n1)+cos(200*pi*n1);
subplot(2,1,2);
stem(n1,xn);
title(\' discrete plot of the signal in Nyquist rate\');
N.B. the Nyquist sampling frequecy is twice the frequency that contents in the signal. Here the given signal comprises of two sinusoidal component. one component has a frequency of 150Hz and the other has 100. sampling frequecny is made on highest frequency content in the signal. so the highest frequency in the signal is 300*pi*t=2*pi*f*t
or f=150Hz
so in Nyquist sampling frequency will be,
fs=2*f=300Hz
and the Nyquist sampling rate will be 1/fs=n1
tf is the range in time in which you want to plot the signal.

