Hi Michael.
Mein Quelltext war an sich schon richtig, mein Problem war nur, dass
ich als Filter einen Tiefpass benutzt habe. Also hatte ich auf meinem
Ausgangssignal eine Gleichspannung, die sich als unangenehmes
Quietschen bemerkbar gemacht hat und den Ausgang unbrauchbar gemacht
hat.
Der Quelltext sieht jetzt ungefähr so aus:
...
// (input + |input| ) / 2 = one way rectification
float einwegglr(float Input)
{
Input = (Input + fabsf(Input))/2;
return 3*Input;
}
// filtering method --> uses external configurable filter coefficients
short Fir(short Input)
{
int i, Sum, Prod;
States[0]= Input;
Sum= 0;
for(i=0;i<M;i++)
{
Prod= Coef[i]*States[i];
Sum= Sum+Prod;
}
for(i=M-1;i>0;i--)
{
States[i]= States[i-1]; /* update states x(k- i):=x(k-(i-1))
*/
}
return ((float) (Sum>>15)); /* cast output to 32-bits and
return
*/
}
void processing(void)
{
Output = Input;
}
/* interrupt service routine
interrupt void CodecIsr()
{
Uint32 McbspOut,Out;
Int16 temp;
/* shift left channel to bits 15 - 0 and extend sign into bits 31 -
16 */
temp = (Int16) ( MCBSP_read(hMcbsp1) >> 16 );
Input = (float) temp;
einwegglr(Input);/* one way rectification by absolute values*/
Fir(Input); /* band pass filter ( 100 - 4000 Hz ) */
processing(); /* function for sending demodulated input to output
*/
Out = (Uint32) Output;
McbspOut = ( Out<<16 )|( Out & 0x0000ffff );
McbspOut = (Out<<16);
MCBSP_write(hMcbsp1,McbspOut);
return;
}
...
Nun stehe ich allerdings vor dem nächsten Problem - die nächste Stufe
wäre dann ein quadratischer Hüllkurvendemodulator.
Also praktisch: quadrieren(Eingang), Tief- (oder Band)pass(Eingang),
wurzel(Eingang).
Nur funktioniert das irgendwie so nicht.
Hast Du vielleicht ne Idee?