Sunday, February 5, 2012

sampling process using matlab

clear all
close all
clf
fb=1000                                     %baseband signal freqquency in hetz
tb=1/fb
fs=40000
ns=fs/fb                                    %number of samples in one period of the base band signal
t=linspace(0,.002,ns)
sq=(1+square(t))/2
asb=5*sin(2*pi*fb*t).*sq
subplot(211)
stem(t,sq)
axis([0 .002 0 1])
xlabel('time in seconds')
ylabel('amplitude in volts')
title('square wave output')
subplot(212)
stem(t,asb)
axis([0 .002 -5 5])
xlabel('time in seconds')
ylabel('amplitude in volts')
title('simulation of samplig process')

                                                                                                  





"Success often comes to those who dare to act. It seldom goes to the timid who are ever afraid of the consequences."

- Jawaharlal Nehru

No comments:

Post a Comment

DC motor control with Pulse Width Modulation Part 1

DC Motor intro DC motor is a device which converts electrical energy into kinetic energy. It converts the DC power into movement. The typica...