|
|||||||
| Home | Forums | Rules | Articles | Store | Gallery | Blogs | Register | Donations | FAQ | Calendar | Search | Today's Posts | Mark Forums Read | Search |
| Digital Line Level DACs, Digital Crossovers, Equalizers, etc. |
|
Please consider donating to help us continue to serve you.
Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving |
|
![]() |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
diyAudio Member
Join Date: Dec 2008
|
Hello all,
I am looking for a way to digitally decode a WAV file and output a voltage level for every time sample. So for a 44.1kHz WAV file that would be a voltage level every 20µs. Is there any way to emulate digitally what a DAC does? I realize WAV files are PCM, so I'm not sure how to convert that to a time varying signal. The goal is to output a voltage vs time plot from an audio recording, and then perform an FFT of that dataset. It seems like there should be some algorithm for doing this, but I have been unable to find anything online. Any suggestions or ideas would be greatly appreciated! Thanks in advance. |
|
|
|
#2 |
|
Banned
|
I recently asked for the author of Visual Analyser Visual Analyser 2011
to include a feature permitting FFTs of files to be performed, but I haven't received an answer. In the absence of such a feature the simplest thing is to use 2 PCs. (It might be possible to do output and input simultaneously on one PC) Connect the audio output of one PC to the input of the second (or connect 1 PC in loopback). Run VA or other audio analysis program (AudioTester). Play the audio file on the software player of your choice. Capture the FFT into the analysis program. w |
|
|
|
#3 |
|
diyAudio Member
Join Date: Dec 2008
|
Wakibaki,
Let me know if you hear anything back from about the Visual Analyser. I considered your recommendation which would pass the signal through a DAC and then get recorded by an ADC to get the data. There has to be a better way; one that doesn't introduce distortion by having to loop from digital to analog then back to digital. |
|
|
|
#4 |
|
Banned
|
OK I have written to the author again...
An FFT is not a difficult algorithm. You could just print out the values, say 8192 of them, then do the butterflies manually. It would take a while... Or if you have software skills, read the .wav and write a program to do it. I could do it, but it's a while since I wrote anything like that, I'm a bit lazy. I'll look it up and see how much work it would take... w |
|
|
|
#5 |
|
Banned
|
You can do an FFT in Excel if you load the Data Analysis toolpack:
http://userwww.sfsu.edu/~larryk/Comm.../Excel.FFT.pdf You can even graph it with the charting functions. Here's a hex editor: Freeware Hex Editor XVI32 Here's the header format for .wav files: https://ccrma.stanford.edu/courses/4...ts/WaveFormat/ w |
|
|
|
#6 |
|
diyAudio Member
Join Date: Feb 2003
Location: ..
|
quite a few freeware options - that read .wav directly
SciLab, Octave are MatLab work-alikes, both free, handle more points than Excel but still not good for more than a few x 10e7 points some syntax to master - I know SciLab, OK graphic interface, Octave rumored to run MatLab scripts better? - may need xwav scripts for 24 bit - actually more efficient to save as 32 bit wav in Audacity and read as 32 bit in SciLab - playing with bytes is expensive LtSpice free simulator can read in .wav in a sim - you can then look at the fft in the plot tools, read magnitude, phase, compare ratios with dual cursors - handy if you're familiar with LtSpice Audacity is a freeware sound editor project - not the highest res fft but good for stimulus/response playback/recording through a soundcard and extensive wav editing tools Last edited by jcx; 20th November 2010 at 11:52 PM. |
|
|
|
#7 |
|
diyAudio Member
Join Date: Aug 2008
|
A standard PCM wav file (They can contain various other things) is in essence a header plus a stream of sample values so plotting from the sample values is trivial in either the sample value or frequency domain.
Emulating the reconstruction filter so that you actually get something that looks like an analogue signal takes a little more work, especially if you are changing magnification often.... I don't know about Windows but on Linux there is JAAA and JAPA depending on exactly what you want to see for running realtime plots and any number of file IO utilities for reading the source data. Failing that, hack something together with FFTW, libSoundFile and Gnuplot, should take less then an hour even given Windows pathetic excuse for a command shell. Regards, Dan. |
|
|
|
#9 |
|
diyAudio Member
Join Date: Feb 2003
Location: ..
|
there are some oddities - Ltspce .TRAN will do a 1st order linear interpolation between points, if you use a high resolution time step, long fft record size you won't see the classic 1:1 reflection of the spectum around fs/2 - but the passband below fs/2 should still be representative (the images are sinc^2 filtered by the 1st order hold)
you could tweak the .tran settings, fft length to get closer to the "pure math" DiracDelta "no order hold" plots you would get with SciLab, ect also you need to learn about window functions - but that applies to getting clean results from any time limited fft (I default to using Blackman) Last edited by jcx; 21st November 2010 at 12:50 AM. |
|
|
|
#10 |
|
Banned
|
Looks like Audacity is the easiest, you can just load the .wav, highlight the bit you're interested in by clicking and dragging the cursor, and going Analyze/Plot Spectrum. It doesn't provide a lot of illumination as to exactly what it's doing though. You can set the number of samples and the window, but it doesn't say whether it starts at the beginning, processes the number of samples and quits or whether it starts again and overlays the results or what.
LTSpice is a bit idiosyncratic in the UI, I haven't got it to work yet, but now I'm thinking Octave or Scilab is going to be the best option for fine control. As regards the windowing, which I'd forgotten about in the context of writing a program, it's most convenient to be able to switch between them and observe the effect. Of those available in Audacity only the Hanning is of much use, and it doesn't seem to apply it consistently anyway. The leakage with the others is considerable, as can be seen if you generate a tone and then analyse it. w |
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| To WAV or not to WAV? | Godzilla | Digital Line Level | 110 | 30th September 2011 05:16 AM |
| software to compare wav to wav played back through speaker? | freddi | Multi-Way | 2 | 28th March 2010 04:29 PM |
| First time caller, long time listener... | smallangryboy | Introductions | 15 | 19th March 2005 08:10 PM |
| midi to wav? | Horse lover | Instruments and Amps | 3 | 27th August 2004 09:00 PM |
| Opinions on my low-voltage hybrid headphone amp (this time with the right file) | JHawk24821 | Headphone Systems | 2 | 1st August 2004 04:49 PM |
| New To Site? | Need Help? |
| Page generated in 0.12940 seconds (81.97% PHP - 18.03% MySQL) with 10 queries |