This is filters.c in view mode; [Download] [Up]
#include "../sms.h" /* pre-emphasis filter function, it returns the filtered value * * float fInput; sound sample */ float PreEmphasis (float fInput) { static float fLastValue = 0; float fOutput = 0; fOutput = fInput - EMPHASIS_COEFF * fLastValue; fLastValue = fOutput; return (fOutput); } /* de-emphasis filter function, it returns the filtered value * * float fInput; sound input */ float DeEmphasis (float fInput) { static float fLastValue = 0; float fOutput = 0; fOutput = fInput + EMPHASIS_COEFF * fLastValue; fLastValue = fInput; return(fOutput); }
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.