.

meiFilterPosfilterSet

Declaration

 
long meiFilterPostfilterSet(MPIFilter             filter,
                            long                  *sectionsCount,
                            MEIPostfilterSection  *sections);
 

Required Header: stdmei.h

Description

meiFilterPostfilterSet sets the number of postfilter sections within an MPIFilter object and configures each postfilter section as well. If numberOfSections equals zero, then sections can be NULL and the postfilter will be disabled.

The MPI calculates the post filter coefficients and takes into consideration the sample rate of the controller at that time. If you change the sample rate of the controller, you will need to recalculate the post filters. This can be done for all filters specified in Hertz by setting the filters again with the MPI. The MPI will calculate the filters using the current servo sample rate.

Postfilters are used to digitally filter the output of a control loop. One common use for postfilters is the compensation of system resonances.

 
filter the handle of the MPIFilter object whose postfilter sections will be configured.
*sectionsCount the number of postfilter sections to set in the filter object.
*sections a pointer to an array of MEIPostfilterSection data structures to be set in filter.
   
 
Return Values
MPIMessageOK  

Sample Code


/*   Set a 4th order low-pass post-filter by using 
     two 2nd order low-pass sections. 
     Sample usage:   

     returnValue =        
         fourthOrderLowPass(filter, 300 /* Hz */);
*/
long filterFouthOrderLowpass(MPIFilter filter, long breakPointFrequency)
{
    MPIFilterConfig config;
    MEIPostfilterSection section[MEIMaxBiQuadSections];
    long returnValue;

    section[0].type = MEIFilterTypeLOW_PASS;
    section[0].form = MEIFilterFormINT_BIQUAD;
    section[0].data.lowPass.breakpoint = breakPointFrequency;
    section[1] = section[0]; /* copy first section */
 
    returnValue =
        meiFilterPostfilterSet(filter, 2, section);

    return returnValue;
}

See Also

MEIPostfilterSection | meiFilterPostfilterGet | meFilterPostfilterSectionSet | MEIMaxBiQuadSections | Post Filter Theory

 

       Legal Notice  |  Tech Email  |  Feedback
      
Copyright ©
2001-2010 Motion Engineering