sdr.rectangular(sps: int, span: int = 1, norm: 'power' | 'energy' | 'passband' = 'energy') NDArray[float_]

Returns a rectangular pulse shape.

Parameters:
sps: int

The number of samples per symbol.

span: int = 1

The length of the filter in symbols. The length of the filter is span * sps samples, but only the center sps samples are non-zero. The only reason for span to be larger than 1 is to add delay to the filter.

norm: 'power' | 'energy' | 'passband' = 'energy'

Indicates how to normalize the pulse shape.

  • "power": The pulse shape is normalized so that the maximum power is 1.

  • "energy": The pulse shape is normalized so that the total energy is 1.

  • "passband": The pulse shape is normalized so that the passband gain is 1.

Returns:

The rectangular pulse shape.

Examples

In [1]: h_rect = sdr.rectangular(10)

In [2]: plt.figure(figsize=(8, 4)); \
   ...: sdr.plot.impulse_response(h_rect);
   ...: 

In [3]: plt.figure(figsize=(8, 4)); \
   ...: sdr.plot.magnitude_response(h_rect);
   ...: 
../../_images/sdr_rectangular_1.png ../../_images/sdr_rectangular_2.png

See the Pulse shapes example.