If I instantiate in Matlab a filter, a vector, and use them in the following way:

vector = (complex(randn(1,k), randn(1,k)))';
filt = comm.RaisedCosineTransmitFilter('RolloffFactor',sdrqpsktx.RolloffFactor,'FilterSpanInSymbols',sdrqpsktx.RaisedCosineFilterSpan,'Gain',1,'OutputSamplesPerSymbol',sdrqpsktx.Interpolation)

  comm.RaisedCosineTransmitFilter with properties:

                     Shape: 'Square root'
             RolloffFactor: 0.5000
       FilterSpanInSymbols: 10
    OutputSamplesPerSymbol: 2
                      Gain: 1
output = filt(vector);

output will be a k*2 x 1 complex double. This is because of the OutputSamplesPerSymbol setting. The documentation on this function states that

The raised cosine filter has (FilterSpanInSymbols x InputSamplesPerSymbol + 1) taps.

So this filter has 2*10+1 = 21 taps. How then is the output computed? If you take the convolution of the coefficients of filt and vector you will get a (k+taps-1)x1 complex double, which makes sense to me because the output of a FIR filter is the convolution of its impulse response with the input signal. How then is output a k*2 x 1 complex double?


The filter computes OutputSamplesPerSymbol output samples for each input value. You would get the complete convolution if OutputSamplesPerSymbol were equal to $1$ and if you added zeros to your input signal until the filter memory contains no non-zero input values anymore.

This is the standard way a filter routine works; if there is no interpolation or decimation, it computes one output sample per input sample because usually the complete input signal is not stored in a buffer, but it arrives either sample-per-sample or it is split into several blocks.

| improve this answer | |
  • $\begingroup$ I dont understand what you mean when you say "until the filter memory contains no non-zero input values anymore" Also, any idea how this computation actually happens? Is there some formula it is using? I'm trying to convert this function into C code but i'm getting stuck $\endgroup$ – yellow_watermelon Aug 14 '19 at 12:57
  • $\begingroup$ @yellow_watermelon: You need to understand how an FIR filter works. The filter memory contains past input values that are linearly combined to compute to output. After the last input sample, the memory is still filled with past input values. With each zero at the input, the old input values are shifted through the register and at a certain point (determined by the filter length) the memory is filled with only zeros. $\endgroup$ – Matt L. Aug 14 '19 at 13:17
  • $\begingroup$ Do you have any links or books or anything else to recommend that i can read or learn from? $\endgroup$ – yellow_watermelon Aug 15 '19 at 3:09
  • $\begingroup$ @yellow_watermelon: In this answer there's a link to a very good (and free) book. $\endgroup$ – Matt L. Aug 15 '19 at 14:43
  • $\begingroup$ i also found this: github.com/jgaeddert/liquid-dsp/blob/master/src/filter/src/… Thank you! $\endgroup$ – yellow_watermelon Aug 17 '19 at 0:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.