LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to play ultrasonic to audio output

I'm monitoring an ultrasonic transducer operating in the 150Khz range and want to phase shift the sound to audio that can be played over the PC speaker output channel. The signal is very much like white noise with ocasional spikes that are very short in duration, around 100 microseconds.

 

I'm sampling the input at 500k samples / second so I need a way to not only shift the noise to the audio range but also not miss the spikes when resampled down to the ~40k samples / second for the audio output.

 

Any suggestions would be greatly appreciated.

 

thanks,

t

0 Kudos
Message 1 of 8
(3,773 Views)

terry,

 

What do you want the output signal to be? Suppose the input signal was a sine wave at 150 kHz with an amplitude of 0.1 and the spike was a rectangular pulse of duration 100 us and amplitude 1 superimposed on the sine wave. What frequency should the audio (output) sine wave be? What should the duration of the output spike be? Does the timing of the start of the output spike need to preserve the phase relationship to the input sine?

 

The method for transforming the signal may depend on the details fo the answers.

 

Lynn

Message 2 of 8
(3,734 Views)
The easiest is to play it back 20-30 times slower, if this is a continous process that might be a problem.
/Y
G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 3 of 8
(3,710 Views)

Yes, it's not phase shifting, it's frequency shifting (heterodyning).  All that you need to do is change the dT parameter of your waveform and play it back.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
Message 4 of 8
(3,708 Views)

First, Thanks to all for the quick replies.

 

I'm monitoring the signal in near real-time, so playback at a slower speed isn't an option.

 

What frequency should the audio (output) sine wave be? What should the duration of the output spike be? Does the timing of the start of the output spike need to preserve the phase relationship to the input sine?

 

In the past, this has been done in HW and just output to a small 3 inch speaker so the preservation of the original signal isn't critical but being able to hear the pops is the desired result. I'm trying to get more information about the analog circuit that accomplished this.

 

The transducer itself is tuned for a frequency response around 155KHz. The source is very low power and already amplified 60db before getting captured on the NI device. The ambient nominal noise level is tuned in HW to be around 5 milivolts.

 

I've got a lot of latitude on the ouput. The duration of the spike needs to be sufficiently long just be audible and there is no sine to be concerned about phase. I'm processnig the signal at 10Hz.

 

I have taken a couple swipes at this problem. The first hurdle is that the signal is so low that once you amplify it to be audible, it's difficult to hear the spikes from the white noise. A spke may be as low 15 milivolts. The second is that when resampling for the audio, the spike can be skipped over completely.

 

My current approach is to first multiply the ultrasonic signal with a low frequency sine wave and then use a bandpass filter to try to filter out a harmonic. This seems to help improve the signal to noise ratio. The second step is to inspect every sample and dynamically amplify and widen each based on the level in order to make the spikes more pronounce. Finally, I resample the signal to meet the audio parameters and continuously play the result through the system speakers.

 

I'm not an EE so please excuse if my attempt to explain is less than optimal Smiley Wink

 

Thanks,

t

0 Kudos
Message 5 of 8
(3,692 Views)

Sounds like you just need a simple limit check or threshold detector if your spike is 3X your noise floor.  Look in the Signal Processing > Wfm Measurement > Wfm Monitoring palette for some VIs that will help.  Post your current code if you need more assistance...

 

Also, why not make this system visual?  You can display the raw data and analyze it on the fly counting the spikes and flashing an indicator.  If you're going to translate hardware into software anyway, it's a good time to enhance the functionality.  Smiley Wink

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
Message 6 of 8
(3,669 Views)

Second point first - We are already doing the visual - this is all working well using graphs, plots, red/green pass fail indicators, digital level readouts, etc. Our specification requires both a visual and audio component.

 

My audio is OK, but not as dynamic as the original system used to produce. I've been scouring the internet and NI's articles for other options that I may not have identified yet and now I'm checking with the brain-trust to see if anyone has any ideas on how better to accomplish this.

 

Thank you for taking the time to respond and your suggestions!

t

 

 

0 Kudos
Message 7 of 8
(3,656 Views)

I agree with NIquist. If all you really want is an audible indication of the spikes, detect them with a simple threshold and then generate an output pulse that makes the kind of sound you want.  Square pulses or half sine pulses may not make a very good audible result. A short (10-20 ms) noise burst is very audible.

 

Lynn

0 Kudos
Message 8 of 8
(3,647 Views)