How to generate Sine and triangle wave using HDL blockset?

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 comentarios

HDL blockset contains MATLAB Function block. Is it allowed?
Sawtooth matlab function is not supported by HDL coder.

Iniciar sesión para comentar.

 Respuesta aceptada

Bharath Venkataraman
Bharath Venkataraman el 14 de Dic. de 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 comentarios

How to create sawtooth wave of 2-5khz in simulink for hdl code
You can use the HDL Counter block for this purpose or a Lookup table with the appropriate values.

Iniciar sesión para comentar.

Más respuestas (0)

Productos

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by