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