Community
cancel
Showing results for
Did you mean: Beginner
95 Views

## How the frequencies are normalized for ippsFIRGenBandpass_64f

Dear all,

I would like to use IPP band pass filter function

ippsFIRGenBandpass_64f(rLowFreq, rHighFreq, taps, tapslen, ippWinBartlett, ippTrue, pBuffer) )

However rLowFreq and rHighFreq are normalized frequency between [0,0.5]. Could you confirm how the frequency normalization should be done? Is it

f / fmax / 2

In my calculation window?

Thanks and regards,

Tianhua Employee
95 Views

Hi Tianhua,

the algorithm that is used is described below:

/*//////////////////////////////////////////////////////////////////////////////
//
//    This code section computes one half of coeffitients (taps) vector
//
//    ALGORITHM:
//    if tapsLen is odd it make filter Type I [Mit93]. It must be calculated:
//         (this do in this code section)
//          taps[center] = 2  * (rHighFreq - rLowFreq) ,
//          taps[center + i] = (sin(2 * PI * rHighFreq * i) -
//                            - sin(2 * PI * rLowFreq  * i)) / (PI * i) ,
//         (this do in normalization code section)
//          taps[center - i] = taps[center + i],
//            i = 1, 2, center ;
//    if tapsLen is even it make filter Type II [Mit93]. It must be calculated:
//         (this do in this code section)
//          taps[center + i] = (sin(2 * PI * rHighFreq * (i - 0.5)) -
//                            - sin(2 * PI * rLowFreq  * (i - 0.5)) / (PI * i) ,
//         (this do in normalization code section)
//          taps[center - i] = taps[center + i],
//            i = 1, 2, center ;
//
//    The following properties are used:
//      a) PI * i = PI * (i - 1) + PI
//                                   for accelerate PI *  i,
//         PI * (i - 0.5) = PI * ((i - 1 )- 0.5) + PI
//                                   for accelerate PI*(i-0.5);
//      b) - sin(alfa) = cos(alfa + 1/2 * PI)
//                     and
//           sin(alfa) = cos(alfa + 3/2 * PI) = cos(alfa - 1/2 * PI)
//                                   for nspdTone using;
//
*/
/*//////////////////////////////////////////////////////////////////////////////
//
//    Taps normalization, if doNormal != 0,
//        and making another half of taps vector
//
//    Algorithm:
//      The frequency response of highpass FIR filter equal one
//           near average frequency (rLowFreq + rHighFreq) / 2.0,
//           if coefficients vector is normalized.
//      Therefore H(rAverageFreq) = 1 .
//      In [Mit 93] (see page 176) frequency response simplified for filter
//      Type I & II:
//               if tapsLen odd (Type I)
//                  H(rAverageFreq) =  taps[center] +
//                                     + 2 * halfsum{taps[center+i] *
//                                     * cos(2 * PI * rAverageFreq * i)}
//               if tapsLen even (Type II)
//                  H(rAverageFreq) =  2 * halfsum{taps[center+i-1] *
//                                     * cos(2 * PI * rAverageFreq * (i - 0.5))}
//      here sqrt   - square root,
//           halfsum{} - sum (sigma) from i = 1 to i = center.
//
//      In code:
//      if doNormal == 0
//         only make second half of taps;
//      if doNormal != 0
//         gain = 1 / |H(rAverageFreq)| ,
//         taps =  taps * gain, i = center, center + 1, ... , tapsLen - 1;
//         and make another half of taps.
//
*/

regards, Igor 