Conversion from ascii to wav
Conversion from ascii to wav
(OP)
SPL data was recently requested and taken on several different steppermotors for an automotive application. That data was collected using an FFT analyzer (RealTime octave Analysis). The data was then provided to the customer, as requested in 1/3 octave bands in EXCEL. The data was first saved as an ascii file and then imported in EXCEL per the customers request. The customer is now asking if we could send them a wav file for them to listen to via their PC.
Is anyone aware of conversion type software that can convert ascii files to wav? I would hate to have to repeat the process.
Thanks!
Is anyone aware of conversion type software that can convert ascii files to wav? I would hate to have to repeat the process.
Thanks!





RE: Conversion from ascii to wav
Use this rather nasty Basic program to generate custom .wav files, then play them back using the Media Recorder. This generates a double, ramped, 1 or 2 kHz tone (can’t remember), which is lousy for testing, fine for what I want. If you need longer samples (you will) then increase the length of the source .wav in sound recorder, and modify the program. Obviously you need to start with a wav file long enough to contain your data, and to replace the loop that generates the tone with your ascci data.
ding.wav is used to generate a valid header as I couldn’t find the .wav file format.
Frequency accuracy is unknown, but probably ok .Voltage calibration will be unique to your system.
Good Luck
OPEN "ding.wav" FOR INPUT AS #1
OPEN "tone.wav" FOR OUTPUT AS #3
FOR m = 1 TO 128
i$ = INPUT$(1, #1)
PRINT m + k + j * 20 + 800 * i, i$, ASC(i$)
PRINT #3, i$;
NEXT m
FOR i = m TO 11598
f = 1000
c$ = STR$(INT(128 + (SIN(i / (11598 - m) * 2 * 3.142)) * (125 * SIN(i * f / 22050 * 6.28))))
'PRINT i, c$
IF VAL(c$) < 0 THEN c$ = STR$(1)
PRINT #3, CHR$(VAL(c$));
NEXT i
CLOSE
STOP
FOR i = 0 TO 11
FOR j = 0 TO 39
FOR k = 1 TO 20
i$ = INPUT$(1, #1)
PRINT m + k + j * 20 + 800 * i, i$, ASC(i$)
NEXT k
INPUT s$
CLS
NEXT j
NEXT i
CLOSE
STOP
Cheers
Greg Locock
RE: Conversion from ascii to wav
If you take your averaged FFT, and IFFT them then you will get an impulsive noise, because you have lost the phase information.
Rule 1: Except in the most trivial case record your data before analysing it.
Rule 2: Keep the original data until the end of the contract, and as long as possible afterwards.
Rule 3: Keep the tape record sheets as well
Rule 4: You always lose the vital piece of data
I have every tape record sheet from the last 12 years hidden in my filing cabinet, and, admittedly, a stack of tapes that we can't play back. But if we had to, we could find the right sort of tape recorder. Much cheaper than building a prototype and testing it!
Cheers
Greg Locock
RE: Conversion from ascii to wav
Cheers
Greg Locock