From Saturday, Nov 23rd 7:00 PM CST - Sunday, Nov 24th 7:45 AM CST, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Saturday, Nov 23rd 7:00 PM CST - Sunday, Nov 24th 7:45 AM CST, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
10-25-2016 09:35 AM
Hello,
I would like to do simple audio measurements (level, THD, frequency) in LabVIEW with a sound card.
The audio signal is a simple analog 1kHz sine tone.
I know it's better to do this with a real audio analyzer, but this would be a significant investment.
So how can this be achieved with a standard PC sound card?Thanks.
Solved! Go to Solution.
10-25-2016 09:43 AM
Yes, in the 'sound input' palette, there are VIs for configuring, starting and stopping the recording of your computers audio input in LabVIEW. There are numerous examples in the Example Finder in LabVIEW (Help -> Find Examples... -> type 'sound').
10-25-2016 12:10 PM
Ok, and what do I do with the recording (e.g. a WAV file) to get these values like level, THD, frequency?
10-25-2016 02:56 PM
@schuller wrote:Ok, and what do I do with the recording (e.g. a WAV file) to get these values like level, THD, frequency?
If you looked at the Examples, you would know how to get the data into a LabVIEW Array of Waveforms. Now you need to do a little more research (= learning = tutorials) to know how (a) "level" is represented in a Wav file, (b) what "level" means, and (c) how to analyze the frequency content of a waveform.
Once you've done that, start coding. I'd start with just reading the Wav file, outputting (for yourself) some simple parameters such as number of channels, number of points, frequency of sampling, and total time represented by the file (just to see if your code seems to be doing the right thing, and you know how to do these simple steps). Then start on the analysis.
If you get stuck, come back here, post your code (attach the actual VIs, don't waste our time showing a picture of part of the VI), and we'll try to help. But you need to "do the work" ...
Bob Schor
10-25-2016 05:54 PM
I apologize if you got the impression I'm not willing to do the work by myself. I just thought it would speed things up, if somebody would point me to right direction. That's what the board is for, right?
10-25-2016 06:53 PM - edited 10-25-2016 06:54 PM
@schuller wrote:I apologize if you got the impression I'm not willing to do the work by myself. I just thought it would speed things up, if somebody would point me to right direction. That's what the board is for, right?
What Bob means when saying "do the work" is that you have to do the legwork necessary to understand what a waveform is and how to take measurements before you can even begin coding.
And Bob is stressing to upload "real code" because a picture of a block diagram is as useful to us as this picture
is not useful to someone trying to troubleshoot an xml file.
10-26-2016 09:14 AM
There are a lot of soundcard based signal analysing tools for free ... audacity .. speclab ...
For a correct level measurement you would need a calibrated mic / sound aquisition system... for 1kHz at least a pistophon..
10-26-2016 09:26 AM
I could perform a basic measurement (amplitude, frequency) with the following code:
10-26-2016 09:44 AM - edited 10-26-2016 09:57 AM
Just add the vi for THD and your done 🙂
Create a producer consumer architecture
producer : cont. mic input
consumer : your data analysis ...