Square wave generator similar to dsp.SineWave

8 views (last 30 days)
I know squarewave() function, but I would like to know is there an equivalent system object square wave generator, just like dsp.SineWave so I can generate 1024 samples per loop for demodulation purposes in streaming processing of audio signals.
Thanks
  2 Comments
masnoob
masnoob on 8 Jan 2019
Edited: masnoob on 8 Jan 2019
I actually have implemented stream processing where the entire process is real time based, contained within a while loop, currently using sine wave but I just want to produce square wave instead in matlab, not simulink.

Sign in to comment.

Accepted Answer

Gabriele Bunkheila
Gabriele Bunkheila on 9 Jan 2019
Please take a look at audioOscillator in Audio System Toolbox, which can generate sine, square, and sawtooth waveforms.
  3 Comments
masnoob
masnoob on 10 Jan 2019
Thanks Gabriele! the solution worked like a charm!

Sign in to comment.

More Answers (0)

Products


Release

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!