from
Continuous square and Discrete square
by Nikhil Prathapani
Generation of Square wave in continuous and discrete time.
|
| sqrr.m |
clear all;
close all;
clc;
fs=1000;
t=0:1/fs:5;
x1= square(2*pi*50*t);
subplot(2,1,1);
plot(t,x1);
axis([0 0.2 -1.2 1.2]);
ylabel('amplitude');
xlabel('time-->');
title('continuous square wave');
subplot(2,1,2);
stem(t,x1);
axis([0 0.2 -1.2 1.2]);
ylabel('amplitude');
xlabel('time-->');
title('discrete square wave');
display(x1);
|
|
Contact us