function x = txFilter(modData, rolloff, span, sps) %% Transmitter pulse-shaping (root raised cosine) filter. %% Inputs: %% - modData: modulated data %% - rolloff: rolloff factor in root raised cosine filter. %% - span: filter span (number of symbols) %% - sps: samples per symbol %% Output: %% - x: pulse-shaped waveform filter = comm.RaisedCosineTransmitFilter... ('Shape', 'Square root', ... 'RolloffFactor', rolloff, ... 'FilterSpanInSymbols', span, ... 'OutputSamplesPerSymbol', sps, ... 'Gain', sqrt(sps)); % so that output has energy 1 x = filter([modData; zeros(span, 1)]); end