Assignment about Fundamental Frequency

Verified

Added on  2022/09/29

|9
|1002
|19
Assignment
AI Summary

Contribute Materials

Your contribution can guide someone’s learning journey. Share your documents today.
Document Page
ASSIGNMENT
By
(Name)
(Course)
(Professor’s Name)
(Institution)
(State)
(Date)

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
Question a...............................................................................................................................1
Question b...............................................................................................................................2
Question c...............................................................................................................................3
Question d...............................................................................................................................4
Question e...............................................................................................................................5
clear;
clc;
close all;
T=1e-3;
A=2;
Question a
Fs=1e6;
t=-T:1/Fs:T;
d_c=2*A/pi; %Dc component of the signal
a_c=0;%Ac component calculation
for n=2:200
a_c=a_c+((-1).^(1+n/2))/(n.^2-1)*cos(2*pi*n*t/T);
end
s_t=d_c+4*A./pi.*a_c;
figure;
plot(t,abs(s_t));
grid on;
xlabel('Time in seconds');
ylabel('Amplitude');
amp=max(abs(s_t));% Amplitude calculation
per=T;% Period calculation
fund=1/T;% Fundamental frequency is obtained when n=1
L=length(s_t);
poww=(norm(s_t).^2)/L; % power calculation in watts
[R, SPURPOW, SPURFREQ] = sfdr(abs(s_t));
powed=SPURPOW; % power calculation in dBW
fprintf('Amplitude: %f volts\n Period: %f seconds\n Fundamental frequency: %f Hz\
Document Page
n',amp,per,fund);
fprintf('Total power in watts: %f watts\n Total power in dBW: %f dBW\n',poww,powed);
Amplitude: 2.015035 volts
Period: 0.001000 seconds
Fundamental frequency: 1000.000000 Hz
Total power in watts: 2.059740 watts
Total power in dBW: -29.002412 dBW
Question b
k=[0 2 4 6];
figure;
grid on;
xlabel('Time in seconds');
ylabel('Amplitude');
hold on;
for i=1:4
Document Page
n=k(i);
s_e=d_c+((-1).^(1+n/2))/(n.^2-1)*cos(2*pi*n*t/T);
plot(t,abs(s_e));
end
legend('n=0','n=2','n=4','n=6')
hold off;
Question c
figure;
hold on;
k=0:10;
for i=1:11;
n=k(i);
s_t=d_c+((-1).^(1+n/2))/(n.^2-1)*cos(2*pi*n*t/T);
subplot(3,4,i);
stem(abs(s_t));
grid on;

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
xlabel('frequency');
ylabel('Power spectral density');
end
hold off;
Question d
fcut=7000*pi*2;
sot=lowpass(abs(s_t),fcut/(2*pi*Fs));
figure;
plot(t,sot);
grid on;
xlabel('Time in seconds');
ylabel('Amplitude');
L=length(sot);
poww1=(norm(sot).^2)/L; % power calculation in watts
powrat=poww1/poww;
f=-1/T:(200/T-7000);
Document Page
highest_freq=max(f);
hh=highest_freq/fund;
fprintf('The highets frequency of So(t) is as multiple of Fo: %f \n',hh);
fprintf('The highets frequency of So(t) in Hz is: %f \n',highest_freq);
fprintf('The total power of So(t) is: %f \n',poww1);
fprintf('The total power of So(t) as a ratio of power of s(t): %f \n',powrat);
% Comment
% The signal resembles the original signal s(t).
The highets frequency of So(t) is as multiple of Fo: 193.000000
The highets frequency of So(t) in Hz is: 193000.000000
The total power of So(t) is: 1.617594
The total power of So(t) as a ratio of power of s(t): 0.785339
Question e
figure;
sfdr(sot);
Document Page
r=sfdr(sot);
hhh=1/T;
a=(200*hhh-7000);
f=-hhh:1e4:a;
pww=[];
for j=1:length(f);
ff=f(j);
for n=2:200;
ss_e=d_c+((-1).^(1+n/2))/(n.^2-1)*cos(2*pi*n*t*ff);
end
L=length(ss_e);
pw=(norm(ss_e).^2)/L; % power calculation in watts
pww=[pww pw];
end
pwwr=pww./poww;
pww_db=10*log10(pww);
q=[pww;pwwr;pww_db];
fprintf('power in watts Normalised power Normalised watts in dB')
q'
fprintf('Dynamic power ratio is: %f\n',r);
power in watts Normalised power Normalised watts in dB
ans =
1.6211 0.7871 2.0982
1.6211 0.7871 2.0982
1.6211 0.7871 2.0982
1.6211 0.7871 2.0982
1.6211 0.7871 2.0982
1.6211 0.7871 2.0982
1.6211 0.7871 2.0982
1.6211 0.7871 2.0982
1.6211 0.7871 2.0982

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
1.6211 0.7871 2.0982
1.6211 0.7871 2.0982
1.6211 0.7871 2.0982
1.6211 0.7871 2.0982
1.6211 0.7871 2.0982
1.6211 0.7871 2.0982
1.6211 0.7871 2.0982
1.6211 0.7871 2.0982
1.6211 0.7871 2.0982
1.6211 0.7871 2.0982
1.6211 0.7871 2.0982
Dynamic power ratio is: 257.678527
Document Page
References
[1] M. J. Roberts, Signals and systems Analysis Using Transform methods and MATLAB,
New York: McGraw-Hill, 2012.
[2] D. Silage, Digital communication Systems using Matlab and Simulink, Bookstand
Publishiing, 2009.
1 out of 9
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]

Your All-in-One AI-Powered Toolkit for Academic Success.

Available 24*7 on WhatsApp / Email

[object Object]