LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Record sound with mic, phase shift 180 degrees, then play?

Solved!
Go to solution

I'm looking to record something with a microphone, phase shift it (up to 180 degrees), then play it into a speaker.

 

Is there a way to do this in Labview?

 

I have various DAQ boards (NI 9233) and a microphone, the Sound and Vibration suite, and a PC with speakers.

0 Kudos
Message 1 of 9
(7,883 Views)
Solution
Accepted by topic author jeff_scharpf

 In LabVIEW>>Help>>Find Examples... search "sound", there are some examples.

Download All
0 Kudos
Message 2 of 9
(7,871 Views)

Thank you for your response. Those are good examples but I'm trying to invert the waveform 180 degrees then play it back.

 

Do I need to do this while recording or can it be done with a wav file during playback?

 

I'm not even sure what it will sound like, but it was asked of me to see if I can do it.

 

Jeff

0 Kudos
Message 3 of 9
(7,821 Views)

Ok so I was able to do it by multiplying by -1... the signal definitely looks inverted by 180 degrees........... but the sound is the same..

 

I'll have to think about that.. maybe 180 degrees out of phase doesn't do anything to the overall sound?

0 Kudos
Message 4 of 9
(7,812 Views)

There is no reason to expect it to sound any different.  Technically, 180 deg phase shift means something different than inverting the signal.  But for continuous, steady state sine waves, the resulting signal will look the same.

 

Human hearing has no means of detecting phase shift, or the polarity of a sound wave.  It is all just a frequency to the human ear.

0 Kudos
Message 5 of 9
(7,807 Views)

I realized this as I thought more about it 🙂

 

I'm not sure why I was asked to do this, maybe I'm not understanding what was expected.

 

In any event, Thanks for the help!

0 Kudos
Message 6 of 9
(7,803 Views)

 


@jeff_scharpf wrote:

I realized this as I thought more about it 🙂

 

I'm not sure why I was asked to do this, maybe I'm not understanding what was expected.

 

In any event, Thanks for the help!


You wont hear any difference playing the inverted sound alone. But if you mix the inverted sound back in with the original they will cancel each other. This is basically how noise reduction headphones work. They have a small microphone that picks up background noise. Then the noise is inverted and played into the headphones. This inverted noise mixes with the 'live' noise in your ear and cancels the noise you hear to some extent.

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 7 of 9
(7,792 Views)

Thanks for that information! I thought it was something like that 🙂

 

0 Kudos
Message 8 of 9
(7,784 Views)

To be precise, human hearing cannot noticeably detect the phase of a point source of sound.  Human hearing does detect phase differences between the two ears and uses these to determine the location of the sound.  This is how the various 3D sound technologies work.  Look up head related transfer functions if you would like more information on this subject.

0 Kudos
Message 9 of 9
(7,736 Views)