Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Square Wave Analysis in Time and Frequency Domains, Study notes of Electrical and Electronics Engineering

Two solutions for analyzing a square wave signal. The first part plots the waveform in the time domain using matlab, while the second part implements the discrete fourier transform (dft) to represent the same signal in the frequency domain. The dft is computed up to 10 terms.

Typology: Study notes

2015/2016

Uploaded on 01/16/2016

ngarg7464
ngarg7464 🇺🇸

1 document

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Ans 1a) Square wave in time
domain
From 0<t<2 f(t)= 1
From 2<t<4 f(t)=0
x = [-1 0 0 1 2 2 3 4 ]
y = [ 0 0 1 1 1 0 0 0 ]
plot(x,y,'-r')
title('square wave in time
domain)
Ans 1b)
n=1:2:200;
b=2/pi./n;
f=1/2;
t=-5:0.1:5;
for i=1:10
f=f+b(i)*sin(t/b(i));
end
plot(n,b)
title('Frequency domain ')
%plot(t,f,'-r')
%title('Reconstructed
square wave using 10
terms')
%xlabel('TIME');
%ylabel('AMPLITUDE');
Time domain 3 terms
pf3

Partial preview of the text

Download Square Wave Analysis in Time and Frequency Domains and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!

Ans 1a) Square wave in time domain From 0<t<2 f(t)= 1 From 2<t<4 f(t)= x = [-1 0 0 1 2 2 3 4 ] y = [ 0 0 1 1 1 0 0 0 ] plot(x,y,'-r') title('square wave in time domain’) Ans 1b) n=1:2:200; b=2/pi./n; f=1/2; t=-5:0.1:5; for i=1: f=f+b(i)*sin(t/b(i)); end plot(n,b) title('Frequency domain ') %plot(t,f,'-r') %title('Reconstructed square wave using 10 terms') %xlabel('TIME'); %ylabel('AMPLITUDE'); Time domain 3 terms

Using 10 terms Ans 1c) Frequency domain upto terms