ADPCM Help

Help for Audacity on Windows.
Forum rules
ImageThis forum is for Audacity on Windows.
Please state which version of Windows you are using,
and the exact three-section version number of Audacity from "Help menu > About Audacity".


Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade at https://www.audacityteam.org/download/.
The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.
Post Reply
armeniki
Posts: 15
Joined: Mon Oct 18, 2010 5:51 am
Operating System: Please select

ADPCM Help

Post by armeniki » Thu Mar 29, 2012 7:48 am

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
Attachments
audio.zip
ADPCM Data
(5.24 KiB) Downloaded 266 times
PD7759.zip
Synthesizer SPECs
(155.11 KiB) Downloaded 183 times

armeniki
Posts: 15
Joined: Mon Oct 18, 2010 5:51 am
Operating System: Please select

Re: ADPCM Help

Post by armeniki » Sat Mar 31, 2012 1:41 am

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

steve
Site Admin
Posts: 81609
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: ADPCM Help

Post by steve » Sat Mar 31, 2012 5:34 pm

armeniki wrote:I know there are a few different varieties of ADPCM so maybe I can download a codec from someplace?
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.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

armeniki
Posts: 15
Joined: Mon Oct 18, 2010 5:51 am
Operating System: Please select

Re: ADPCM Help

Post by armeniki » Sun Apr 01, 2012 12:50 am

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.

steve
Site Admin
Posts: 81609
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: ADPCM Help

Post by steve » Sun Apr 01, 2012 1:10 am

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
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

armeniki
Posts: 15
Joined: Mon Oct 18, 2010 5:51 am
Operating System: Please select

Re: ADPCM Help

Post by armeniki » Sun Apr 01, 2012 1:14 am

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?

steve
Site Admin
Posts: 81609
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: ADPCM Help

Post by steve » Sun Apr 01, 2012 1:39 am

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.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

armeniki
Posts: 15
Joined: Mon Oct 18, 2010 5:51 am
Operating System: Please select

Re: ADPCM Help

Post by armeniki » Sun Apr 01, 2012 9:32 am

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........ :(

ragnar.jensen
Posts: 118
Joined: Thu Jan 26, 2012 7:39 pm
Operating System: Please select

Re: ADPCM Help

Post by ragnar.jensen » Sun Apr 01, 2012 10:44 am

armeniki wrote:
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....
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.
armeniki wrote: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?
soxi identifies your sample as OKI ADPCM, 8kHZ/4bps.

Code: Select all

$ 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...

Code: Select all

$ 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

armeniki
Posts: 15
Joined: Mon Oct 18, 2010 5:51 am
Operating System: Please select

Re: ADPCM Help

Post by armeniki » Sun Apr 01, 2012 11:22 pm

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
Attachments
scan1.JPG
scan1.JPG (33.11 KiB) Viewed 6911 times
scan2.JPG
scan2.JPG (45.72 KiB) Viewed 6911 times

Post Reply