ADPCM Help

Hi guys,

This one’s got me scratching my head… hope you can help.

I’ve got some audio data from a machine I am reparing and need to make changes to it. I have attached some of the audio data to this post from the respective EPROM on the board, you’ll need to unzip it.

When I open the file in Audacity as: RAW (VOX ADPCM), 8000 sampling rate - it does not come out very clear… in fact it’s really bad and the waveform looks like it’s upwards?

It’s definitely 8khz as far as sample rate… maybe I have to change the bit rate? Although not sure where.

If it helps, I have also attached a zipped .PDF of the Synthesizer that’s being used which has these specs:

Synthesizing method : ADPCM, PCM + waveform element methods used together
Sampling frequency : 5, 6 or 8 kHz
Bit rate (speech) : 20 to 32 K bps

I know there are a few different varieties of ADPCM so maybe I can download a codec from someplace? Hope someone can help.

Cheers
PD7759.zip (155 KB)
audio.zip (5.24 KB)

Does anyone have a clue? Any hints or help would be appreciated. :slight_smile:

The problem with .RAW files is that they are “headerless”. That is, they contain only the data and no information about what the actual data format is. If you don’t already know the format being used the only approach is trial and error.

“VOX ADPCM, 8000Hz mono” is the only setting that I’ve found to produce anything intelligible.

Thanks Steve, I’ve also tried that setting and it is the only one that results in something comprehensible.

I think I know what needs to be done but am not sure that Audacity has that ability… basically, if you look at the datasheet for the synthesizer, it states that the bit rate is 20k to 32k bits per second… I cannot seem to find this setting anywhere in Audacity so I cannot test.

The bit rate for ADPCM is the sample rate times the number of bits per sample, so 8kHz with 4 bits per sample would be 32 kbps.
http://en.wikipedia.org/wiki/Pulse-code_modulation
http://en.wikipedia.org/wiki/Dialogic_ADPCM

Hmm… well if the specs state that it can be within a range (20k to 32k) then it must be the bits per sample that I have to change… because I know for a fact it is 8kHz sample rate. Question is where to I change the bits per sample?

At 4 bits per sample the audio quality will be pretty poor.
The waveform produced by importing as “VOX ADPCM, 8000Hz mono” looks far more “normal” if you apply a high pass filter to it at say 50 Hz. After doing that you will need to use the Amplify effect to bring the peak level back to within 0 dB.

At 4 bits per sample the audio quality will be pretty poor.

Yes, normally I’d agree, but in this case this exact data results in crystal clear audio on the machine…

So I guess really I need to find an audio software that allows me to adjust the bits per sample setting then. It would be nice to have Audacity have that feature one day.

The aim for my project is to be able to record updated prompts for the machine and then write that ADPCM data back to the EPROM and put it back in service… so I really need to be able to convert it to and from… :frowning:

Well, it is after all Adaptive Differential PCM. It doesn’t save the full sample values. Most of the saved data is the difference compared to the previous sample, encoded in 4 bits. 4-bit ADPCM will yield about 12-bit precision.

soxi identifies your sample as OKI ADPCM, 8kHZ/4bps.

$ soxi audio.vox
soxi WARN raw: `audio.vox': sample rate not specified; trying 8kHz

Input File     : 'audio.vox'
Channels       : 1
Sample Rate    : 8000
Precision      : 12-bit
Duration       : 00:00:01.49 = 11904 samples ~ 111.6 CDDA sectors
File Size      : 5.95k
Bit Rate       : 32.0k
Sample Encoding: 4-bit OKI ADPCM

And it is OKI ADPCM encoded, almost…

$ sox -r 8k audio.vox -e signed -b 16 -r 44100 audio.wav vol 0.5 highpass 75

sox WARN adpcms: audio.vox: ADPCM state errors: 771

The 771 state errors tell us that NEC have done their own thing to the codec.
Time to contact NEC, I think.


Ragnar

Thanks Ragnar, I believe you are correct… I found a user manual for the UPD7759 IC (I can’ post it because it’s over 2 MB but I have attached screenshots) and there is mention of some tools… in Section 1.4 they mention the NV-300 Speech analysis tool and on the next page in Figure 1.4 they describe the entire process where things are converted … encode to ADPCM then decode to PCM…

So I believe the next step is to contact NEC or Renesas now and see if they can provide me with this NV-300 tool… I checked out the Internet and found this cached webpage but the links don’t work so I HOPE they have something in their archives!

Cheers
scan2.JPG
scan1.JPG