Sunday, February 5, 2012

sampling using matlab

 clc
 clear all
 close all
fsm=4000
f=1
t=0:(1/fsm):1
m=sin(2*pi*f*t)
figure(1)
plot(t,m)
subplot(211)
plot(t,m)
subplot(212)
plot(m)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%% generating impulse train %%%%%%%%%%%%%%%%

fs=(100*f);
s=sin(2*pi*fs*t);
k=s;
k(k<1)=0;
sam=k;
figure
plot(s);
hold all
plot(sam,'k')

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
sample=m.*sam;
%%
figure
plot(sample)
hold all
plot(m)

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...