- DSP log - http://www.dsplog.com -

Update: Correction in Matlab code for raised cosine filter

Posted By Krishna Sankar On May 25, 2008 @ 4:36 pm In DSP | 9 Comments

Thanks to the keen observation by Mr. Phan Minh Hoang, I was notified that the Matlab/Octave scripts provided along with the topic raised cosine filtering was not behaving properly.

Reason: I was not taking care of the division by zero when creating the raised cosine filter taps.

The equation for raised cosine filter is

$g(t) = \left(\frac{sin(\pi t/T)}{\pi t/T}\right)\left(\frac{cos(\alpha \pi t/T)}{1-(2\alpha t/T)^2}\right),\mbox{ } t=-\infty \mbox{ to } +\infty$

where
$\alpha$is the excess bandwidth parameter and takes values from 0 to 1.

I was not taking care of the division by zero in the above equation. I updated the code to explictly handle the division by zero case where:

(a) $\frac{sin(\pi x)}{\pi x} =1$ for $x=0$ and

(b) $\frac{cos(\alpha \pi t/T)}{1-(2\alpha t/T)^2}=\frac{\pi}{4}$ for $|\frac{\alpha t}{T}| = \frac{1}{2}$

(Thanks to the article in RFDesign.com, The care and feeding of digital, pulse-shaping filter [1], Ken Gentile)

The updated posts are:

Thanks again Mr. Phan Minh Hoang.

All,
In case you find errors and inconsistencies in the article and/or simulation models, kindly let me know.
Regards,
Krishna

URL to article: http://www.dsplog.com/2008/05/25/update-correction-in-matlab-code-for-raised-cosine-filter/

URLs in this post:

[1] The care and feeding of digital, pulse-shaping filter: http://rfdesign.com/mag/radio_care_feeding_digital/

[2] Raised cosine filter for transmit pulse shaping: http://www.dsplog.com/2008/04/22/raised-cosine-filter-for-transmit-pulse-shaping/

[3] Eye diagram with raised cosine filtering: http://www.dsplog.com/2008/05/01/eye-diagram-plot-matlab-raised-cosine-filter/

[4] click here to SUBSCRIBE : http://www.feedburner.com/fb/a/emailverifySubmit?feedId=1348583&loc=en_US