主要内容

rectpulse

矩形脉冲整形

说明

Y = rectpulse(X,nsamp)X 执行矩形脉冲整形并返回 Y,通过将每个采样重复 nsamp 次来增大 X 的采样率。

示例

示例

全部折叠

创建一个由调制符号组成的数组。第一个通道(列)包含 QPSK 调制符号。第二个通道包含 16QAM 调制符号。

M_psk = 4;   % PSK modulation order
M_qam = 16;  % QAM modulation order
nsymb = 10;  % Number of modulated symbols

ch1 = pskmod(randi([0 M_psk - 1],nsymb,1),M_psk,pi/4);
ch2 = qammod(randi([0 M_qam - 1],nsymb,1),M_qam);
X = [ch1 ch2];

绘制调制符号的实部和虚部。

figure
subplot(2,1,1)
stem(real(X))
grid on
xlabel('Symbols')
ylabel('\Re(X)')
subplot(2,1,2)
stem(imag(X))
grid on
xlabel('Symbols')
ylabel('\Im(X)')

Figure contains 2 axes objects. Axes object 1 with xlabel Symbols, ylabel \Re(X) contains 2 objects of type stem. Axes object 2 with xlabel Symbols, ylabel \Im(X) contains 2 objects of type stem.

设置每符号的采样数。

nsamp = 4;

执行矩形脉冲整形并显示结果。

Y = rectpulse(X,nsamp);
figure
subplot(2,1,1)
plot(real(Y),'-') 
grid on
xlabel('Samples')
ylabel('\Re(y)')
ylim([-3.5 3.5])
subplot(2,1,2)
plot(imag(Y),'-')
grid on
xlabel('Samples')
ylabel('\Im(Y)')
ylim([-3.5 3.5])

Figure contains 2 axes objects. Axes object 1 with xlabel Samples, ylabel \Re(y) contains 2 objects of type line. Axes object 2 with xlabel Samples, ylabel \Im(Y) contains 2 objects of type line.

输入参数

全部折叠

输入符号,指定为向量或矩阵。如果 X 是具有多个行的矩阵,该函数将列视为独立通道。

数据类型: double | single
复数支持:

每符号的采样数,指定为正整数。

数据类型: double | single

输出参量

全部折叠

输出采样,以向量或矩阵形式返回。

  • 如果输入 X 是向量,则输出是一个 L 元素向量,由 X 中的每个采样重复 nsamp 次组成,其中 Llength(X)*nsamp

  • 如果输入 X 是矩阵,则函数将每列作为独立通道处理,输出是 L×M 矩阵,其中 Lsize(X,1)*nsampMsize(X,2)

数据类型与 X 的数据类型相同。

扩展功能

全部展开

C/C++ 代码生成
使用 MATLAB® Coder™ 生成 C 代码和 C++ 代码。

版本历史记录

在 R2006a 之前推出

全部展开