Thursday, 3 October 2013

How to generate Square wave, of frequency fm, in Matlab?

How to generate Square wave, of frequency fm, in Matlab?
% let fm = 10Hz

fm = 10;
fs = 1000; %Hz -- sampling frequency
t = 0:(1/fs):1;
squareWave = sign(sin(2*pi*fm*t));

No comments:

Post a Comment