From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Dynamic Signal Acquisition

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with writing to sound file

Hi all,

I did this VI:

sound.png If I connect "My sound to spreaker I obtaine te right processing I did.

However if I connect it to file write  I obtain a totally deformed sound even if a did no processing.

did anyone know how to solve this problem?

thanks

0 Kudos
Message 1 of 5
(7,022 Views)

Where did you insert your file write? 

 

One high-level observation is that you are using filters in a loop to process multiple channels. This can lead to poor results because it incorrectly allows filter state to be swapped between channels. Playing the waveform to the sound output of your computer can significantly change the execution or timing of the program depending on how it is implemented. Please attach your VI.

Doug
NI Sound and Vibration
0 Kudos
Message 2 of 5
(7,011 Views)

here is my VI. You can compare sound output and file output.

 

 


One high-level observation is that you are using filters in a loop to process multiple channels. This can lead to poor results because it incorrectly allows filter state to be swapped between channels. Playing the waveform to the sound output of your computer can significantly change the execution or timing of the program depending on how it is implemented.
I have to apply an atypic filter to th sound:

 

250Hz 3rd order Highpass butterworth fileter

20kHz 3rd order Loawpass butterworth filter

and  filter with this TF:

Sans titre.png

using FFT, Mathscript, and FFT-1 was the only way I found to do that (Control and simulation Transfer functions don't work correctly in this case)

 

0 Kudos
Message 3 of 5
(7,009 Views)
Woops! I forgot the VI
0 Kudos
Message 4 of 5
(7,008 Views)

Hi,

You forgot to configure the sound format of sound file write open vi. By default the sample rate is 22100 kHz, is that why the sound on the file was bad.

I changed you're Vi (I just add a wire between sound file write open vi and the sound file info vi).

Regards

Yann C.

France

0 Kudos
Message 5 of 5
(6,991 Views)