Speech storage

If you've got the filter in hardware, then you can simply take sample 1 as the first sample, sample (5+6)/2 as the second, sample 11 as the third, ... (So you're picking a sample every 1/8Khz, and compensating for the fact that you've not got an exact sample at sample 5.5) To play back, linear interpolation is probably not too bad. If you can record at 8.8Khz, then just ignore the above, and use every 5th sample.

Reply to
Ian Stirling
Loading thread data ...

To be 'the most correct', you must use reampling, both of the times as the factor between 44.1kHz and 8kHz is not an integer but a rationnal.

You can search for polyphase resampling.

formatting link

Of course, as suggested in another post, just taking one sample every N samples would be an easy way to proceed. And linear interpolation for upsampling.

Another solution is to use a speech compression algorithm that will give you

Reply to
Sylvain Munaut

Any one have an code example how to implement upsampling interpolation using a microcontroller and lookup table?

cheers mark

Sylva> > Hi guys,

Reply to
Marky

Hi guys,

I am trying to store 8 kHz speech onto flash memory. I am using an msp430 microcontroller, which has both ADC & DAC for recording and playing back. To minimise hardware, I want to set the ADC sample rate at 44 kHz and the down sample it to 8 KHz for storage, and to play back I want to up sample it back to 44 KHz.

How would I do this? What kind of digital filters do I need (assuming I filtered out the microphone input to roll off 3dB at 4 KHz) for the down and up sampling?

Any help will be appreciated

Reply to
john smith

First, are you FORCED to have 8khz, or can you do with 8.82 khz or 7.350 khz ?

Theses gives respectively a nice 1/5 and 1/6 ratio.

Then for upsampling that would be (not tested ...) :

#define UPSAMPLE 5

int is,os,us; unsigned short in[SIZE_IN], out[SIZE_IN*UPSAMPLE]; unsigned short lut[UPSAMPLE] = { 0x0000, 0x3333, 0x6666, 0x9999, 0xCCCC };

for (os=0, is=0 ; i> 16;

/* Copy last sample */ /* Note that if it's a continuous stream, that will be part of the next frame */ out[SIZE_IN*UPSAMPLE - 1] = in[SIZE_IN-1];

Marky wrote:

Reply to
Sylvain Munaut

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.