Filter cascade with raised cosine filter and half-band filter
    조회 수: 6 (최근 30일)
  
       이전 댓글 표시
    
I've created a raised cosine filter and a half-band filter, respectively, and want to cascade them. However, I got "Numeric stages of size [1 11] are not supported. All numeric stages must be scalars."
Fs = 20e3;
Fp = 15e3;
rc = rcosdesign(0.35, 5, 2, 'sqrt');
Fs2 = 4*Fs;     % Sample rate
Fp2 = Fp;   % Passband edge
Fh2 = Fs2/4;      % Halfband frequency
TW2 = (Fh2-Fp2)/Fh2;
N2 = 48;
hb2 = designHalfbandFIR(FilterOrder=N2,...
                        TransitionWidth=TW2,...
                        Passband='lowpass',...
                        DesignMethod='kaiser',...
                        Structure='interp',...
                        SystemObject=true);
Fc = cascade(rc, hb2);
I also created the raised cosine filter with comm.RaisedCosineTransmitFilter to see if this works. However, MATLAB returned another error, "Cascades must be made of discrete-time filter (DFILT) objects.".
Fs = 20e3;
Fp = 15e3;
rc = comm.RaisedCosineTransmitFilter;
Fs2 = 4*Fs;     % Sample rate
Fp2 = Fp;   % Passband edge
Fh2 = Fs2/4;      % Halfband frequency
TW2 = (Fh2-Fp2)/Fh2;
N2 = 48;
hb2 = designHalfbandFIR(FilterOrder=N2,...
                        TransitionWidth=TW2,...
                        Passband='lowpass',...
                        DesignMethod='kaiser',...
                        Structure='interp',...
                        SystemObject=true);
Fc = cascade(rc, hb2);
Why two codes show different errors and what am I supposed to cascade two filters?
댓글 수: 0
채택된 답변
  Paul
      
      
 2025년 3월 28일
        Fs = 20e3;
Fp = 15e3;
rc = rcosdesign(0.35, 5, 2, 'sqrt');
Fs2 = 4*Fs;     % Sample rate
Fp2 = Fp;   % Passband edge
Fh2 = Fs2/4;      % Halfband frequency
TW2 = (Fh2-Fp2)/Fh2;
N2 = 48;
hb2 = designHalfbandFIR(FilterOrder=N2,...
                        TransitionWidth=TW2,...
                        Passband='lowpass',...
                        DesignMethod='kaiser',...
                        Structure='interp',...
                        SystemObject=true);
whos rc hb2
rc = dsp.FIRFilter(rc);
Fc = cascade(rc, hb2);
I'm not familiar with the DSP Toolbox. Why does hb2 have a sample rate (and where did it come from as it's not specified in the call to designHalfBandFIR?)
hb2.SampleRate
but rc does not have a sample rate?
rc.SampleRate
Regardless, I hope this at least points you in the right direction.
추가 답변 (0개)
참고 항목
카테고리
				Help Center 및 File Exchange에서 Filter Analysis에 대해 자세히 알아보기
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

