# Extracting filter coefficients from raised-cosine frequency response

The frequency response of filter transfer function is given as

$$H(j\omega)= \begin{cases} 0 &, \textrm{if }\quad (1+r)\frac{\pi}{2} < \lvert \omega \rvert < \pi \\ 1 + \cos \left ( \frac{\pi}{2r}\left ( \frac{\lvert 2\omega \rvert}{\pi} + r-1 \right ) \right ) &, \textrm{if }\quad (1-r)\frac{\pi}{2} < \lvert \omega \rvert\leq (1+r)\frac{\pi}{2}\\ 2&, \textrm{if }\quad \lvert \omega \rvert\leq (1-r)\frac{\pi}{2} \end{cases}$$

where $r = 0.1$. I need to extract filter coefficients for the given FIR filter response or order $24$. How can I perform the task using MATLAB?

Since the corresponding impulse response is of infinite length, you need to truncate it symmetrically. Since the given filter order is $24$, you have 25 filter taps (assuming a common FIR solution). This means one tap at $n=0$, and $12$ taps for $n>0$ and $n<0$, respectively. For truncating the ideal impulse response, you can use any type of window. The most straightforward way is simple truncation, i.e., using a rectangular window.