フィルターのクリア

How to use "sine hdl optimized" block?

9 ビュー (過去 30 日間)
Himadri Debnath
Himadri Debnath 2021 年 4 月 11 日
回答済み: Ishan Ghosekar 2022 年 8 月 26 日
I need digital sine wave for my verilog project. For that I need fixed point sinusoidal signal. I am using MATLAB hdl coder. I want to apply "sine hdl optimized" block to get the lookup table data. But I don't know what to use as a input.
Basically I need to generate a 100 Hz sine wave sampled at 44.1 kHz. So what should I use as the input 'u' and output?
  2 件のコメント
Bharath Venkataraman
Bharath Venkataraman 2021 年 4 月 12 日
You may want to consider using the NCO HDL Optimized block. If you compute the phase offset based on your output clock, you can use the sine output to get the desired signal.
Bharath Venkataraman
Bharath Venkataraman 2021 年 4 月 13 日
I had answered a similar question on generating a sine wave here. There is a model attached in that response that may be useful.

サインインしてコメントする。

回答 (1 件)

Ishan Ghosekar
Ishan Ghosekar 2022 年 8 月 26 日
As I understand, you want to generate sine wave of 100Hz sampled at 44.1 KHz using Sine HDL Optimized block and you would like to know what inputs can be provided to the block.
I have attached the model that can be used to generate desired sine wave.
In the attached model, I have used HDL Counter and Gain block. The HDL Counter block runs from 1 to sampling frequency (fs), 44.1KHz, at a sample time of 1/fs. Specify the gain value of Gain block as sinusoidal wave frequency (f)/fs. The output of gain block is given as input to Sine HDL Optimized block.
The generated output of the block is shown in figure below:

Community Treasure Hunt

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

Start Hunting!

Translated by