• AVR Freaks

Dsp Library

Author
bss
New Member
  • Total Posts : 1
  • Reward points : 0
  • Joined: 2017/04/16 02:04:51
  • Location: 0
  • Status: offline
2019/12/30 08:30:53 (permalink)
0

Dsp Library

Hi 
 
I have been trying to implement an IIR Filter for a while using the dsPIC30F DSP Library. However, things do not seem to work quite well, for this filter implementation. Are there any one who has been working with this filter.
 
I am trying to filter a 16kHz audio signal using this method.
 
IIRTransposed (blockLength, iyr, xr, &IFilterR);
 
And the filter has been configured using 
 
fractional dbIr_1[2], dbIr_2[2]; // Delay-Line-Buffer I-Filter Right (Segment 1 and 2)
IIRTransposedStruct IFilterR;
IFilterR.coeffsBase=iFilter; // Sets the filtercoefficients
IFilterR.numSectionsLess1=1; // Define number of sections
IFilterR.finalShift=2; // Define shift of output (-1 indecate shift left, 1 indicate shift right)
IFilterR.delayBase1=dbIr_1; // Sets the delayline buffer
IFilterR.delayBase2=dbIr_2; // --
IFilterR.coeffsPage=COEFFS_IN_DATA; // Coefficient are stored in data space
IIRTransposedInit(&IFilterR); // Initialize the filter
 
And the filter is 
 
const float iFilter_float[10] = { 0.99 , 0.125 ,  -0.125 ,  0.125, 0.125,  0.99 , 0.125 , -0.125 , 0.125 , 0.125};
 
Which work ok, however, when I change the coefficients, moving the poles and zeros closer to the unit circle, making the slope steeper, the filter introduce laud noise or get quiet due to overflow I believe.
 
In the documentation I found the implementation to be
section 1                    section 2
{b0, b1, a1, b2, a2 ... b0, b1, a1, b2, a2}
 
But it seems like this is not working the right way. Are there anybody out there, having any success with this filter library?
 
I have simulated the same filter in matlab, and here it works fine.
 
 
And another question, as far as I can see, this filter rely on fractional of Q15, so the coefficients needs to be within the range of -1...0.99999, how do you scale your coefficients to be in that range?
 


#1
Jump to:
© 2020 APG vNext Commercial Version 4.5