%% Reduce Input Size Restriction by Adjusting Tolerance
% Create a dsp.FarrowRateConverter System object™ with 0% tolerance. The output rate is equal to the OutputSampleRate property. The input size must be a multiple of the decimation factor, M. In this case M is 320.

frc = dsp.FarrowRateConverter('InputSampleRate',96e3,'OutputSampleRate',44.1e3);
FsOut = getActualOutputRate(frc) 
[L,M] = getRateChangeFactors(frc) 

%
% Allow a 1% tolerance on the output rate and observe the difference in decimation factor.

frc.OutputRateTolerance = 0.01; 
FsOut2 = getActualOutputRate(frc) 
[L2,M2] = getRateChangeFactors(frc) 

% The decimation factor is now only 13. The lower the decimation factor, the more flexibility in input size. The output rate is within the range OutputSampleRate \pm 1%.
%
% Copyright 2015 The MathWorks, Inc.