How to generate Sine and triangle wave using HDL blockset?

20 views (last 30 days)
I need to generate Sine and triangle wave using HDL blockset only. As direct waveform generator is not available in HDL blocks. Can you please suggest how to generate Sine wave and Triangle wave in which I can change Frequency and phase of waveform.
  2 Comments
Birdman
Birdman on 14 Dec 2017
HDL blockset contains MATLAB Function block. Is it allowed?
Pravin Kokane
Pravin Kokane on 14 Dec 2017
Sawtooth matlab function is not supported by HDL coder.

Sign in to comment.

Accepted Answer

Bharath Venkataraman
Bharath Venkataraman on 14 Dec 2017
You can use the NCO HDL Optimized block to generate a Sine wave.
The sawtooth can either be from a RAM (if you need it to be really simple), or with adders/subtractors and some logic for picking either increment/decrement.
  2 Comments
Thirusabaresaan P
Thirusabaresaan P on 27 Jun 2022
How to create sawtooth wave of 2-5khz in simulink for hdl code
Bharath Venkataraman
Bharath Venkataraman on 27 Jun 2022
You can use the HDL Counter block for this purpose or a Lookup table with the appropriate values.

Sign in to comment.

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!