SampleRateIn = [2448000000/40, 2448000000/20, 2448000000/10, 2448000000/5];
FirInterpolation = [64, 32, 16, 8];
FirDecimation = [255, 255, 255, 255];
SampleRateOut = SampleRateIn .* FirInterpolation ./ FirDecimation;
Ratio = SampleRateIn ./ SampleRateOut;
for i = 1 : length(SampleRateIn)
samplesPerFrame = FirDecimation(i)*i;
sine = dsp.SineWave(1,SigFreq,'SampleRate',SampleRateIn(i),'SamplesPerFrame',samplesPerFrame);
y1 = resample(x,FirInterpolation(i),FirDecimation(i));
firrc = designMultirateFIR(FirInterpolation(i),FirDecimation(i),'SystemObject',true);
tx = (0:length(x)-1)/sine.SampleRate;
[delay,FsOut] = outputDelay(firrc,FsIn=FsIn);
ty1 = (0:length(y1)-1)/FsOut;
ty2 = (0:length(y2)-1)/FsOut-delay;
stem(tx,x,'filled',MarkerSize=4)
legend('Original Signal','using resample','using designMultirateFIR')
str = sprintf("SRin=%.1fMHz FirInt=%d FirDec=%d SRout=%.2fMHz Ratio=%f", SampleRateIn(i)/1e6, FirInterpolation(i), FirDecimation(i), SampleRateOut(i)/1e6, Ratio(i));