LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Frequency shift error using S&V Recorder (DAQmx)

Hi

I am having the smple rate problems using a 9233. The sampling as previously discussed elsewhere on the forum is an integer division of 50kS/s. I wish to write the input channels to Microsoft ".wav" files using the standard SV Toolkit vi however it writes asumming the waveform is 44.1kS/s or the nearest integer division!

I have used the resampling vi and this does not help since regardless of which "dt" value is used in the resampling the timescale is "respected" and the resulting waveform is still wrong.

I have a 1000 Hz microphone calibrator playing into a high quality microphone connected to the 9233 and all the realtime S&V vi's are showing correct amplitude and frequency. The recorded wave file is written with RIFF header information saying 44,100 Hz using various RIFF reading software and therefore it always plays back on all players at 88.2 % of the speed or frequency!

Has anybody managed to solve this problem yet?

Can NI please correct the S&V Toolkit vi's since they are intended to be used with the DAQmx?

I have posted on the DAQ hardware forum last week but there has been no response, there may be more traffic here and I have to issue this as a working tool.

http://forums.ni.com/ni/board/message?board.id=250&message.id=25413

Many thanks for any help that you can offer. 

Message Edited by Midlothian on 10-30-2006 03:19 AM

0 Kudos
Message 1 of 26
(3,152 Views)
Some Attachments:
 
 
Figure 1. The simple setup Calibrator, Mic, 9233, High Spec. Laptop.
 
 
Figure 2.   The real time VI's are looking good.
 
 
Figure 3. The Playback shows the Frequency Shift Error  88.2 % of the correct signals.

 

Message Edited by Midlothian on 10-30-2006 05:08 AM

0 Kudos
Message 2 of 26
(3,140 Views)
Surely somebody else has used the Recorder vi and found this serious malfunction?
Are there any NI Applications Engineers who would care to comment?
 
Thank you.
0 Kudos
Message 3 of 26
(3,115 Views)

Hi,

Which VI did you use to convert to wav file? Have you tried the 'SVXMPL_WAV Power Spectrum.vi ' to read the wav file back? Will it be ossiblefor you to attach a small (2sec) wav file thus created?

Kallis

 

Message Edited by Kallis on 10-31-2006 04:37 AM

BR
Message 4 of 26
(3,116 Views)
SVXMPL_WAV Recorder (DAQmx) was used to record the wave file.
 
The RIFF "WAVE" (wave file)
 
PCM format
1 channel
44100 frames per sec
88200 bytes per sec
2 bytes per frame
16 bits per sample
 
I attach a small sample that was recorded at 1kHz.

(please change the extension back to .wav of course)

 

Message Edited by Midlothian on 10-31-2006 05:08 AM

Message Edited by Midlothian on 10-31-2006 05:10 AM

Download All
0 Kudos
Message 5 of 26
(3,109 Views)

Hi,

You were right about the 50kS/s limit. So I tried to simulate a signal with 10Hz, 20hz & 1000Hz(for lack of card) and wrote it to the wav file. Here I used the 'resample Waveforms (continuous).vi. As you an see I gave the dt as (1/44100). After this when I tried to read the wav file back using the SVXMPL_Wav power Spectrum.vi, I got the correct results(see figure). Are you using the same resample VI?

Kallis

BR
Download All
Message 6 of 26
(3,092 Views)
I did use the same resample vi
 
Can you show an image without the resample because the simulated signal doesn't give this error?
 
The timebase for the simulated appears to be respected - the error is with the DAQ interpretation rounding from "sample rate" to "actual sample rate".
 
Thank for having a go !
 
Cheers
0 Kudos
Message 7 of 26
(3,073 Views)
I am afraid it is not as pretty as yours, but here is a view of my Block Diagram for the modified SVX_Snd Write Waveform (DAQmx).vi , which is a sub-vi of the Recorder.
 
 
The sampling "dt" value does not influence to waveform written to the .wav file since the written rate is always 44,100 Hz regardless and the timescale of the original waveform is maintained.

Message Edited by Midlothian on 10-31-2006 11:11 AM

0 Kudos
Message 8 of 26
(3,064 Views)

I got some probes to prove this point.

I used dt = 2e-5  and dt = 2.26757e-5 to make the point that the resampling respects the timescale.

Looking at 1 ms duration on the probes you get a full cycle in both "dt" cases. This is of course correct for 1 kHz input.

The problem of the wave file been written with an incorrect rate seems to be happening later in the process.

 

 

 

Message Edited by Midlothian on 10-31-2006 11:28 AM

Message Edited by Midlothian on 10-31-2006 11:29 AM

Download All
0 Kudos
Message 9 of 26
(3,059 Views)
Just a quick thought...as you told the problems sets in later in the process...
 
Make the reset input of the resample vi true in the first iteration and then make it false for the subsequent iterations  .
 
Please let me know whether this helps...
 
Kallis
BR
0 Kudos
Message 10 of 26
(3,043 Views)