LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sinewave output distortion

Hi,

 

I used sine function inside the while loop and generated continuous sine wave with sampling frequency 10000Hz.

The output I connected to the graph chart and loudspeaker.

 

The graph chart looks fine and I have output sound from loudspeaker, but it is not sound like correct frequency I want. For example 100Hz, 300Hz, 500Hz.

 

What is wrong in my code?

 

Thank you

Download All
0 Kudos
Message 1 of 7
(3,136 Views)
What do you mean that it doesn't sound like the correct frequency? What kind of hardware reconstruction filter are you using?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 7
(3,110 Views)
You are writing a single sample in a loop that spins as fast as possible. You have zero control of the output frequency.
0 Kudos
Message 3 of 7
(3,095 Views)

Hi Mike.

 

I am using NI myRIO-1900 analog out port. It looks like multiple frequncies or some kinda distortion, not sure.

 

0 Kudos
Message 4 of 7
(3,091 Views)

Hi Dennis,

 

Yes, I think that is the problem. How I can solve the problem. should I use timed loop instead?

 

 

0 Kudos
Message 5 of 7
(3,089 Views)

Here is the timed loop sine wave. The sound it much better. But there is some background noises.

 

In youtube there are some 1000Hz test sounds, and when I play them with loudspeaker, the sound is pure, and only one sound with one frequency. When I use my code, the sound had some other elements. not sure what it is. 

 

How I can generate pure sound with single tone without background noises?

 

Thank you

0 Kudos
Message 6 of 7
(3,078 Views)
Do you have a hardware filter on the analog output? The output from the DAC is not the smooth waveform you see on the graph. The output changes by discrete steps. Try Googling "reconstruction filter".

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 7 of 7
(3,049 Views)