Hi all, could someone expound a little about interpolation, more particularly as implemented on the dsPIC Here's the relevant section of the 33F64GP802 data sheet Section 33. Audio Digital-to-Analog Converter (DAC) http://ww1.microchip.com/downloads/en/DeviceDoc/70211B.pdf I've had a look around Microchip and found Piecewise Linear Interpolation http://ww1.microchip.com/downloads/en/AppNotes/00942A.pdf which uses a table, not hardware and generally, http://en.wikipedia.org/wiki/Upsampling http://en.wikipedia.org/wiki/Sample_rate_conversion For example, I have a data table which holds 16-bit values for a sine wave, in degree steps (included below if anyone wants it) Now, if I wanted to output a 1Hz sine wave, that would mean retrieving new data each 1/360th (2.78ms) of a second. If it was a 1kHz sine wave output, then new data each 1/360,000th (2.78us) Section 33 says - "The digital interpolation filter up-samples the input signal to create additional interpolated data points. The over-sampling ratio is 256:1, or 256x the incoming sampling rate. For example, a 100 ksps input signal (the maximum sampling rate) produces 25.6M data points per second" So my retrieval rate from a data store is the 'sampling rate' ? If I interpret correctly, Table 33-1 shows that if this were data for a variable or irregular wave (eg speech or music), the over-sampling clock is set to the maximum frequency component. eg for a digitised 44.1kHz signal, the over-sampling clock would need to be set to (256 * 44100), or 11.289600MHz To make full use of the interpolation then, is it simply necessary to have an over-sampling clock that is only as fast as the highest component or should it be *at least* as fast as the highest component ? IOW, if the over-sampling clock is fast enough (256kHz) to interpolate data for a 1kHz signal, then how does it interpolate just 256 intermediate points at 1Hz ? Joe ;0 - 90 degrees, 16-bit decimal ; ;Signed ; ;0x7FFF =3D Most positive output voltage ;0x0000 =3D Midpoint output voltage ;0xFFFF =3D Value just below midpoint ;0x8000 =3D Minimum output voltage ;1st quadrant -> table ;2nd quadrant -> reverse table ;3rd quadrant -> -table ;4th quadrant -> reverse -table ;Unsigned ; ;0xFFFF =3D Most positive output voltage ;0x8000 =3D Midpoint output voltage ;0x7FFF =3D Value just below midpoint ;0x0000 =3D Minimum output voltage ; ;1st quadrant -> table + 32768 ;2nd quadrant -> reverse (table + 32768) ;3rd quadrant -> 32767 - table ;4th quadrant -> reverse (32767 - table) sine90: .word 0 ; 0 .word 570, 1143, 1713, 2287, 2857 ; 1 - 5 .word 3424, 3994, 4561, 5124, 5688 ; 6 - 10 .word 6252, 6812, 7369, 7926, 8480 ;11 - 15 .word 9031, 9581,10125,10669,11206 ;16 - 20 .word 11744,12275,12802,13327,13848 ;21 - 25 .word 14365,14877,15384,15886,16384 ;26 - 30 .word 16875,17364,17845,18324,18796 ;31 - 35 .word 19261,19720,20175,20621,21063 ;36 - 40 .word 21498,21924,22347,22763,23169 ;41 - 45 .word 23569,23966,24349,24729,25099 ;46 - 50 .word 25466,25820,26168,26508,26839 ;51 - 55 .word 27164,27482,27786,28085,28376 ;56 - 60 .word 28658,28930,29195,29451,29697 ;61 - 65 .word 29933,30162,30381,30592,30791 ;66 - 70 .word 30981,31165,31335,31499,31649 ;71 - 75 .word 31794,31928,32049,32164,32269 ;76 - 80 .word 32364,32449,32524,32587,32642 ;81 - 85 .word 32688,32721,32747,32760,32767 ;86 - 90 --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .