Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Create a program in Matlab with the following parameters. To see the effects of

ID: 1996307 • Letter: C

Question

Create a program in Matlab with the following parameters. To see the effects of aliasing on a 1kHz cosine signal create an over-sampled(sampling rate>>2B, B: the bandwidth of signal), under-sampled(sampling rate<<2B), and critically-sampled (sampling rate=2B) version of the signal.


1. Plot a cosine at 1kHz showing at least twenty periods. Use a step size (sampling period) of 1/10kHz. This will be our over-sampled signal. Try playing this signal with soundsc. How many samples are needed to make the sound last 2 seconds if the step size is 1/10kHz?


2. Plot the critically-sampled version by applying what you know about Nyquist. Make sure the plot contains at least twenty periods and that you sample at a non-zero point. Listen to this signal with soundsc, does it sound the same?


3. Plot the under-sampled version. Make sure the plot contains at least twenty periods. Listen to this signal with soundsc, how does it sound now?


4. Plot all three signals stacked on top of each other using subplot. Note that the plot command uses straight line interpolation, so your plots will not look smooth like Figure 1 (which actually uses a much finer sampling period an knowledge of the aliased frequency to generate the smooth undersampled result).

Explanation / Answer

1)

fs1=10000;

ts1=1/fs1

t=0:ts1:1;

f1=1000;

y1=cos(2*pi*f1*t)

plot(y1,t)

soundsc(y1);

%the samples needed for 2 sec signal is

2/ts1 = 2*fs1 = 20000;

2)

fs2=2000;

ts2=1/fs2

t=0:ts2:1;

f2=1000;

y2=cos(2*pi*f2*t)

plot(y2,t)

soundsc(y2);

%the sound will be almost same at the nyquist frequency.nyquist frequency is 2*sampling frequency.

3)

fs3=1500;

ts3=1/fs3

t=0:ts3:1;

f3=1000;

y3=cos(2*pi*f3*t)

plot(y3,t)

soundsc(y3);

%the sound is distorted and it plays very slowly.

4) subplot(3,1,1);

plot(y1,t);

subplot(3,1,2);

plot(y2,t);

subplot(3,1,2);

plot(y3,t);

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote