NI Home > Community > NI Discussion Forums

LabVIEW

Showing results for 
Search instead for 
Do you mean 
Reply
Member
keni
Posts: 22
0 Kudos
Accepted Solution

convert square wave to sinc wave

Can anyone please show me how to convert square wave to sinc wave?

Trusted Enthusiast
tbob
Posts: 4,089
0 Kudos

Re: convert square wave to sinc wave

What is generating the square wave?  Is it by code or by an external instrument?  What will generate the sine wave, code or instrument?  What kind of hardware is involved?

- tbob

Inventor of the WORM Global
Knight of NI
Posts: 18,064

Re: convert square wave to sinc wave

[ Edited ]

Sinc function

 

Aargh! I hate it when I press the wrong button... Taking the fourier transform of a square wave gives you a sinc function.

Trusted Enthusiast
tbob
Posts: 4,089
0 Kudos

Re: convert square wave to sinc wave

Sine, sinc,  OMG,  :smileysurprised:  I need glasses.

- tbob

Inventor of the WORM Global
Member
keni
Posts: 22
0 Kudos

Re: convert square wave to sinc wave

Thank you guys. I am just using LabView to generate square wave and convert it to the sinc (sync). 

 

Is there any function that will convert pulse into ECG ( Electro Cardio Gram) signal in labview?

Trusted Enthusiast
tbob
Posts: 4,089
0 Kudos

Re: convert square wave to sinc wave

No, you will have to write your own.  Search this forum for ECG.  I remember seeing several posts about it.

Once your code is somewhat written, we can help with problems you might have.

- tbob

Inventor of the WORM Global
Member
keni
Posts: 22
0 Kudos

Re: convert square wave to sinc wave

Thank you again. I have been given a simple project of converting square wave to look like ECG signal. 

What I am thinking is adding sine wave to first 1/4 cycle, adding triangle wave to 2/3 cycle, and adding sine wave to rest 1/4 cycle. Do you think it's possible? How do I go about doing this?

Knight of NI
Posts: 18,064
0 Kudos

Re: convert square wave to sinc wave

While it's possible to do what you're describing, I don't think the results will be all that satisfactory. An ECG signal is a bit more complicated than that. You're probably going to be better off looking (i.e. Google) to see if you can find an ECG waveform simulator/generator.

Trusted Enthusiast
tbob
Posts: 4,089
0 Kudos

Re: convert square wave to sinc wave

[ Edited ]

Use the wave generator funtions found in palette Signal Processing - Waveform Generation.  There are sine and triangle waveform generating functions there.  You can set the number of samples and sample rate such that it would generate a partial waveform.  Then you use Get Waveform Components to get the Y values, concat the values, then use Build Waveform to build it back to a waveform.  You will get a back to back output.  In the following example, I used a sine and square wave because a sine and triangle were too close in appearance and you could not readily see the effect.

 

19413iD726E8314777A307

 

As Smercurio says, I don't think this is a very good representation of an EKG signal.  That signal has P, QRS, and T waves.  There is no sine wave.  The waves are like triangle waves, so just put DC waveforms (0 amplitude square wave) ahead of and in between triangle waves for P, QRS, and T, followed by DC.

 

- tbob

Inventor of the WORM Global
Member
Steve.J
Posts: 195
0 Kudos

Re: convert square wave to sinc wave

There is an ECG simulator module in the NI Biomedical Starter Kit.  You can find more information about this free download by visiting our Biomedical User Group located at www.ni.com/biomedusers

 

Steve

Visit the NI Biomedical User Group at:
www.ni.com/biomedusers