Question

Perform an FFT on the function : f(t) = cos(2712t) + sin (2124t) a. Use a At of 0.01 s and 64 data points and plot the power

0 0
Add a comment Improve this question Transcribed image text
Answer #1

MATLAB code is given below in bold letters.

clc;
close all;
clear all;

% Question a
% define delta_t
ts = 0.01;

% define fs
fs = 1/ts;

% define time vector
t = 0:ts:63*ts;
x = cos(2*pi*12*t) + cos(2*pi*24*t);

% power of the signal computation
N = length(x);
P = 1/N*sum(x.^2)

% PSD computation
xdft = fft(x);
xdft = xdft(1:N/2+1);
psdx = (1/(fs*N)) * abs(xdft).^2;
psdx(2:end-1) = 2*psdx(2:end-1);
freq = 0:fs/length(x):fs/2;

figure;
plot(freq,psdx);grid on;
title('PSD of x(t)');
xlabel('Frequency (Hz)');
ylabel('Power (dB)');

PSD of x(t) Power (dB) O 5 10 15 20 25 30 Frequency (Hz) 35 40 45 50

From the above figure it is observed that the power spectrum has peak at frequencies 12 and 24 Hz which are the frequencies constituting the signal x(t).

% Question b
% define delta_t
ts = 0.05;

% define fs
fs = 1/ts;

% define time vector
t = 0:ts:63*ts;
x = cos(2*pi*12*t) + cos(2*pi*24*t);

% power of the signal computation
N = length(x);
P = 1/N*sum(x.^2)

% PSD computation
xdft = fft(x);
xdft = xdft(1:N/2+1);
psdx = (1/(fs*N)) * abs(xdft).^2;
psdx(2:end-1) = 2*psdx(2:end-1);
freq = 0:fs/length(x):fs/2;

figure;
plot(freq,psdx);grid on;
title('PSD of x(t)');
xlabel('Frequency (Hz)');
ylabel('Power (dB)');


PSD of x(t) Power (dB) 0 1 2 3 7 8 9 10 4 5 6 Frequency (Hz)

From the above figure it is observed that the power spectrum has peak at frequencies 4 Hz and 8 Hz which are not the frequencies constituting the signal x(t). This is because of the fact that the sampling frequency does not meet the required Nyquist sampling rate.

Add a comment
Know the answer?
Add Answer to:
Perform an FFT on the function : f(t) = cos(2712t) + sin (2124t) a. Use a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT