function r = rxFilter(y, rolloff, span, sps) %% Receiver matched (root raised cosine) filter. %% Inputs: %% - y: received waveform %% - rolloff: rolloff factor in root raised cosine filter. %% - span: filter span (number of symbols) %% - sps: samples per symbol %% Output: %% - r: filtered signal (energy not normalized), %% normalize and then sample. rxfilter = comm.RaisedCosineReceiveFilter... ('Shape', 'Square root', ... 'RolloffFactor', rolloff, ... 'FilterSpanInSymbols', span, ... 'InputSamplesPerSymbol', sps, ... 'DecimationFactor', 4, ... 'DecimationOffset', mod(span+1, 4)); coef = coeffs(rxfilter); filter_fft = fft(coef.Numerator, length(y)); y_fft = fft(y); rs = ifft(y_fft .* filter_fft.'); %% re-order signal due to circular conv l = (length(coef.Numerator) - 1) / 2; rr = [rs(l:end); rs(1:l-1)]; r = downsample(rr, 4, 3); end