LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert sine to sawtooth

Solved!
Go to solution
Hi,

I need to convert a DDS generated sinewave to different signals (sawtooth,square,triangle) in Labview FPGA.
I would be grateful if you could help me find an easy way to achieve this.

Thanks in advance!
0 Kudos
Message 1 of 10
(13,154 Views)

Hi Seitseman,

 

the square wave is easy: you just compare the sine wave input with a threshold level…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 10
(13,140 Views)

Hi GerdW,

 

That is definately easy, thanks!

 

However, what do you think about the other ones? Anyone?

 

Thank you!

0 Kudos
Message 3 of 10
(13,133 Views)

Hi Seitseman,

 

determine the sine wave period (using a "simple" detection of zero crossing). Using this value you can create your triangle/sawtooth waveforms…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 10
(13,120 Views)

I had to do arbitrary waveform generation on FPGA.

The DDS block as implemented uses a constant array for the look up table.

I used an FPGA memory block for the LUT and updated it as required from the RTHost using a DMA FIFO.

Then just wrote my own DDS algorithm on FPGA, it isn't that difficult.  You could learn from the sine wave generator express vi.

 

If you have to output multiple waveforms you can just use multiple memories and share the addressing.

 

NI white paper on DDS

 

snippet.png

 

0 Kudos
Message 5 of 10
(13,095 Views)

Hi WillD,

 

Sorry if I didn't explain myself well. I ignored in my explanation the fact that the sinewave is already generated, by the DDS Compiler 6.0 Xilinx IP block, and also that I need to achieve one sample/tick generation, placing the code inside an SCTL.

 

The DDS Compiler offers me the signal generator I need, and lets me vary the output signal frequency the way I want, but it does not support other waveforms rather than sine or cosine, and I would love to generate a sawtooth and triangle using the same mechanism.

 

So if I could perform small changes on the output of the DDS Compiler I would get a handy signal generator that could output different waveforms at very different frequencies, at requested.

 

Thank you!

0 Kudos
Message 6 of 10
(13,085 Views)