www.gusucode.com > dsp 案例源码程序 matlab代码 > dsp/HDLFIRRC5_2.m

    function [dataOut,validOut] = HDLFIRRC5_2(dataIn,validIn)
%HDLFIRRC5_2
% Processes one sample of data using the dsp.HDLFIRRateConverter System
% object. dataIn is a fixed-point scalar value. validIn is a logical scalar value.
% You can generate HDL code from this function.

  persistent firrc5_2;
  if isempty(firrc5_2)  
    Numerator = firpm(70, [0,.15,.25,1], [1,1,0,0]);   
    firrc5_2 = dsp.HDLFIRRateConverter(5,2,Numerator);
  end    
  [dataOut,validOut] = step(firrc5_2,dataIn,validIn);
end