'How to rewrite firrcos in Matlab?

I simulate FIR filter in MAtlab 2018b. I used older version and firrcos works, in the new version it doesnt work. It was suggested to use b = rcosdesign(beta,span,sps,shape) .

b = rcosdesign(beta,span,sps) returns the coefficients, b, that correspond to a square-root raised cosine FIR filter with rolloff factor specified by beta. The filter is truncated to span symbols, and each symbol period contains sps samples. The order of the filter, sps*span, must be even. The filter energy is 1.

Code I used for n = 150 lowpass linear-phase FIR filter with a raised cosine transition band. The filter has cutoff frequency 0,5, transition bandwidth 0,2, and sampling frequency 16:

firrcos(150, .5, .2, 16);

I am not an expert in DSP, could someone help to rewrite it using b = rcosdesign(beta,span,sps,shape) .



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source