# Analog Square Root Raised Cosine Filter

I am wondering if it is possible to realize an analog square root raised cosine filter.

Any idea about how to do that with Matlab?

• matlab is software. Everything software does is inherently digital. Not quite sure what you mean with "realizing" an analog filter, therefore. Do you mean simulate? That would make sense, but given that I'm not aware of a sensible closed-form frequency-domain description, would essentially be equivalent to implementing this as a digital filter (which, be honest here, is also practically the only way you'll ever encounter a RRC: it's something that's easy to build digitally, and hard in analog, and all receivers needing that filter are digital...) – Marcus Müller Jun 17 '20 at 10:59
• I mean in both: simulation and reality so is it possible in reality to have an analog square root raised cosine filter? I am familiar with digital filters, but not analog filters. – Amro Goneim Jun 17 '20 at 11:03

Here's Octave code for a (digital) RRC filter:

pkg load signal;  % Octave needs this; MatLab doesn't
Fs = 16000;  % sample rate
Rs = 400;    % symbol rate
sps = Fs/Rs; % samples per symbol

%
% Root raised cosine pulse filter
% https://www.michael-joost.de/rrcfilter.pdf
%
r = 0.22; % bandwidth factor
ntaps = 8 * sps + 1; % Pulse duration is 8 symbols

st = [-floor(ntaps/2):floor(ntaps/2)] / sps; % symbol time = t/Ts values
hpulse = 1/sqrt(sps) * (sin ((1-r)*pi*st) + 4*r*st.*cos((1+r)*pi*st)) ./ (pi*st.*(1-(4*r*st).^2));

% fix the removable singularities
hpulse(ceil(ntaps/2)) = 1/sqrt(sps) * (1 - r + 4*r/pi); % t = 0 singulatiry
sing_idx = find(abs(1-(4*r*st).^2) < 0.000001);
for k = [1:length(sing_idx)]
hpulse(sing_idx) = 1/sqrt(sps) * r/sqrt(2) * ((1+2/pi)*sin(pi/(4*r))+(1-2/pi)*cos(pi/(4*r)));
endfor

% normalize to 0 dB gain
hpulse = hpulse / sum(hpulse);


For practical reasons, the filter impulse response is truncated to 8 symbols in duration, as there isn't much benefit in making it any longer.

I'm not sure what you mean by "analog" RRC filter in Matlab. The continuous frequency response of the RRC filter is well understood. It results in an infinitely long time domain impulse response, that is the equation in your question with a scaling factor out front.

In the above code, you can make the sample rate as high as you like, to get more closely spaced samples, to have the RRC filter taps get an ever closer approximation to the continuous function in MatLab.

Matlab itself may have facilities for describing continuous functions in the system toolbox, but I am not familiar with them.

As a technical reality, the infinitely long, continuous RRC filter is not realizable in real-life analog components, as it extends infinitely into the past. Could you implement a truncated continuous RRC filter with analog components? Well maybe, but why? Its use is exclusive to digital modulations and it is easily implemented digitally.

• Say that you are running a (non-oversampling) D/A converter at a sample rate equal to the symbol rate. Its interpolation filter would typically have zero-transitions at other than the central symbol (being some windowed sinc function). How far from a rrc filter is that? – Knut Inge Jun 17 '20 at 14:43
• @KnutInge it's obviously very far, but what are you commenting on exactly? – Andy Walls Jun 17 '20 at 15:03
• My point was that the reconstruction filter in a dac is (at least partially) analog and it is a lowpass filter with periodic zero transitions. The existence of one might hint of the possibility of the other. I have a hard time seeing how a linear phase high order filter could be practically realized using r, l and c. Perhaps a bucket brigade filter or SAW device classifies as analog in this context? – Knut Inge Jun 17 '20 at 15:10
• @KnutInge sorry, I'm very confused with how a critically sampling DAC (in which you can't see your nyquist-criterion-adhering digital pulse shaper at all) has to do with the RRC? The answer literally says "meh, you always do the RRC in digital". – Marcus Müller Jun 17 '20 at 20:10
• I was trying to comment on the OT, not Andys answer, sorry about that. An other way to summarize my point is «gee, 1) looks quite similar to 2)». Where 1) is i.stack.imgur.com/P8QF0.png and 2) is en.m.wikipedia.org/wiki/File:Raised-cosine-impulse.svg – Knut Inge Jun 17 '20 at 20:18