diff --git a/package.json b/package.json index 83fe695..f6c1aaf 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "server": "hexo server" }, "hexo": { - "version": "7.1.1" + "version": "7.2.0" }, "dependencies": { "@next-theme/plugins": "^8.20.0", diff --git a/source/_posts/2020-11-25-matlab-rcosdesign.md b/source/_posts/2020-11-25-matlab-rcosdesign.md index f6903f2..2c18da4 100644 --- a/source/_posts/2020-11-25-matlab-rcosdesign.md +++ b/source/_posts/2020-11-25-matlab-rcosdesign.md @@ -26,15 +26,15 @@ date: 2020-11-25 22:32:42 # 说明 -`b = rcosdesign(beta,span,sps)` 返回滚降因子为 `beta` 的根升余弦 FIR 滤波器的系数 `b`。滤波器被截断至 `span` 个符号,并且每个符号周期包含 `sps` 个样本。滤波器的阶数,即 `sps * span`,必须是偶数。滤波器的能量为 1。[举例](#Examples-01) +`b = rcosdesign(beta,span,sps)` 返回根升余弦(square-root raised cosine)FIR 滤波器的系数 `b`。根升余弦 FIR 滤波器的滚降系数(rolloff factor)为 `beta`。滤波器被截断(truncated)为 `span` 个符号,并且每个符号周期包含 `sps` 个采样点。滤波器的阶数 `sps * span` 必须是偶数。滤波器的能量为 1。[示例](#Examples-01) -`b = rcosdesign(beta,span,sps,shape)` 根据 `shape` 返回不同的滤波器。当 `shape` 为 `sqrt` 时,返回根升余弦滤波器;当 `shape` 为 `normal` 时,返回升余弦 FIR 滤波器。[举例](#Examples-02) +`b = rcosdesign(beta,span,sps,shape)` 根据 `shape` 返回不同的滤波器。当 `shape` 为 `sqrt` 时,返回根升余弦滤波器;当 `shape` 为 `normal` 时,返回升余弦(raised cosine) FIR 滤波器。[示例](#Examples-02) # 示例 ## 设计根升余弦滤波器 -将滚降系数设为 `0.25`,滤波器的符号数设为 `6`,每个符号 `4` 个采样点。验证 `sqrt` 是参数 `shape` 的默认值。 +令滚降系数为 `0.25`,滤波器符号数为 `6` 个,每个符号 `4` 个采样点。验证 `sqrt` 是参数 `shape` 的默认值。 ``` matlab h = rcosdesign(0.25,6,4); @@ -47,15 +47,13 @@ mx = max(abs(h-rcosdesign(0.25,6,4,'sqrt'))) fvtool(h,'Analysis','impulse') ``` - - -![ ](../images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-010-DesignASquareRootRaisedCosineFilterExample-01.png?imageMogr2/thumbnail/!100p|watermark/2/text/QEpvc2ggR2Fv/font/YWhyb25iZC50dGY=/fontsize/14/dissolve/20/gravity/southeast/dx/5/dy/5) +![ ](../images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-010-DesignASquareRootRaisedCosineFilterExample.svg) ## 升余弦和根升余弦滤波器的脉冲响应 将升余弦滤波器与根升余弦滤波器进行比较。一个理想的(无限长)升余弦脉冲成形滤波器等效于两个级联的理想的根升余弦滤波器。因此,FIR 升余弦滤波器的脉冲响应应类似于与其自身卷积的根升余弦滤波器的脉冲响应。 -设计一个衰减为 `0.25` 的升余弦滤波器。指定滤波器有 `4` 个符号,每个符号 `3` 个采样点。 +设计一个滚降系数为 `0.25`、符号数为 `4` 个、每个符号 `3` 个采样点的升余弦滤波器。 ``` matlab rf = 0.25; @@ -63,38 +61,34 @@ span = 4; sps = 3; h1 = rcosdesign(rf,span,sps,'normal'); -fvtool(h1,'impulse') +impz(h1) ``` -![ ](../images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-020-ImpulseResponsesOfNormalAndSquareRootRaisedCosineFiltersExample-01.png?imageMogr2/thumbnail/!100p|watermark/2/text/QEpvc2ggR2Fv/font/YWhyb25iZC50dGY=/fontsize/14/dissolve/20/gravity/southeast/dx/5/dy/5) +![ ](../images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-020-ImpulseResponsesOfNormalAndSquareRootRaisedCosineFiltersExample-01.svg) **升余弦滤波器在 `sps` 的整数倍处具有零值点**。因此,它满足无码间串扰(ISI)的 Nyquist 准则。但是,根升余弦滤波器没有这样的特性: ``` matlab -h2 = rcosdesign(rf,span,sps,'sqrt'); -fvtool(h2,'impulse') +h2 = rcosdesign(rf,span,sps,"sqrt"); +impz(h2) ``` -![ ](../images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-030-ImpulseResponsesOfNormalAndSquareRootRaisedCosineFiltersExample-02.png?imageMogr2/thumbnail/!100p|watermark/2/text/QEpvc2ggR2Fv/font/YWhyb25iZC50dGY=/fontsize/14/dissolve/20/gravity/southeast/dx/5/dy/5) +![ ](../images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-030-ImpulseResponsesOfNormalAndSquareRootRaisedCosineFiltersExample-02.svg) 将根升余弦滤波器与自身进行卷积。在最大值处截断脉冲响应,使其长度与 `h1` 相同。使用最大值将响应归一化。然后,将卷积后的根升余弦滤波器与升余弦滤波器进行比较。 ``` matlab -h3 = conv(h2,h2); -p2 = ceil(length(h3)/2); -m2 = ceil(p2-length(h1)/2); -M2 = floor(p2+length(h1)/2); -ct = h3(m2:M2); +h3 = conv(h2,h2,"same"); -stem([h1/max(abs(h1));ct/max(abs(ct))]','filled') -xlabel('Samples') -ylabel('Normalized amplitude') -legend('h1','h2 * h2') +stem(0:span*sps,[h1/max(abs(h1));h3/max(abs(h3))]',"filled") +xlabel("Samples") +ylabel("Normalized Amplitude") +legend("h1","h2 * h2") ``` -![ ](../images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-040-ImpulseResponsesOfNormalAndSquareRootRaisedCosineFiltersExample-03.png?imageMogr2/thumbnail/!100p|watermark/2/text/QEpvc2ggR2Fv/font/YWhyb25iZC50dGY=/fontsize/14/dissolve/20/gravity/southeast/dx/5/dy/5) +![ ](../images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-040-ImpulseResponsesOfNormalAndSquareRootRaisedCosineFiltersExample-03.svg) -卷积响应的长度是有限的,因此根升余弦滤波器与自身进行卷积得到的结果会与升余弦滤波器不一致。增加 `span` 可以在响应之间获得更紧密的一致性,并更好地符合 Nyquist 准则。 +由于卷积响应的长度是有限的,因此根升余弦滤波器与自身进行卷积得到的结果会与升余弦滤波器不一致。增加 `span` 可以在响应之间获得更紧密的一致性,并更好地符合 Nyquist 准则。 ## 将信号通过升余弦滤波器 @@ -103,9 +97,9 @@ legend('h1','h2 * h2') 指定滤波器参数。 ``` matlab -rolloff = 0.25; % 滚降因子 +rolloff = 0.25; % 滚降系数 span = 6; % 滤波器宽度(符号数) -sps = 4; % 每个符号的样本数 +sps = 4; % 每个符号的采样点数 ``` 生成根升余弦滤波器的系数。 @@ -138,31 +132,33 @@ r = x + randn(size(x))*0.01; y = upfirdn(r, b, 1, sps); ``` -有关如何使用根升余弦滤波器对信号进行插值和抽取的信息,请参见使[用 RRC 滤波器进行插值和抽取](https://ww2.mathworks.cn/help/comm/ug/interpolate-and-decimate-using-rrc-filter.html)(Communications Toolbox)。 +有关如何使用根升余弦滤波器对信号进行插值和抽取的信息,请参见使[用 RRC 滤波器进行插值和抽取](https://ww2.mathworks.cn/help/releases/R2024a/comm/ug/filtering.html#mw_fa589f54-fcad-495e-b4f8-4a4ad52c1f1a)(Communications Toolbox)。 # 输入参数 ## `beta` - 滚降系数 -滚降系数,指定为不大于 `1` 的**实非负标量**。滚降系数决定滤波器的多余带宽。滚降系数为 `0` 时为矩形滤波器(brick-wall filter),滚降因子为 `1` 时为纯升余弦滤波器。 +滚降系数,应为不大于 `1` 的**实非负标量**。滚降系数决定滤波器的多余带宽。滚降系数为 `0` 时为矩形滤波器(brick-wall filter),滚降系数为 `1` 时为纯升余弦滤波器。 **数据类型**:`double` | `single` ## `span` - 符号数 -符号数,指定为**正整数标量**。 +符号数,应为**正整数标量**。 **数据类型**:`double` | `single` -## `sps` - 每个符号的样本数 +## `sps` - 每个符号的采样点数 -每个符号的样本数(上采样因子),指定为**正整数标量**。 +> 正整数标量 + +每个符号的采样点数(上采样因子),应为**正整数标量**。 **数据类型**:`double` | `single` ## `shape` - 升余弦滤波器的形状 -升余弦滤波器的形状,指定为 `normal` 或 `sqrt`。 +升余弦滤波器的形状,应为 `"normal"` 或 `"sqrt"`。 # 输出参数 @@ -174,7 +170,7 @@ y = upfirdn(r, b, 1, sps); # 提示 -- 如果您拥有 Communications Toolbox™ 软件的许可证,则可以执行具有流传输行为的多速率升余弦滤波。为此,请使用 System object™ 滤波器——`comm.RaisedCosineTransmitFilter` 和 `comm.RaisedCosineReceiveFilter`。 +- 如果您有 Communications Toolbox™ 软件的许可证,则可以执行具有流式传输行为的多速率升余弦滤波。为此,请使用 System object™ 滤波器——`comm.RaisedCosineTransmitFilter` 和 `comm.RaisedCosineReceiveFilter`。 # 参考 @@ -185,10 +181,6 @@ y = upfirdn(r, b, 1, sps); ## C/C++ 代码生成 > 使用 MATLAB® Coder™ 生成 C 代码和 C++ 代码。 -> ->> 用法说明和限制: ->> ->> 所有输入必须为常数。 如果表达式或变量的值不变,则也允许使用。 # 版本历史 @@ -196,10 +188,10 @@ y = upfirdn(r, b, 1, sps); # 另请参阅 -[`gaussdesign`](https://ww2.mathworks.cn/help/signal/ref/gaussdesign.html) +[`gaussdesign`](https://ww2.mathworks.cn/help/releases/R2024a/signal/ref/gaussdesign.html) ## 主题 -[用 RRC 滤波器进行插值和抽取](https://ww2.mathworks.cn/help/comm/ug/interpolate-and-decimate-using-rrc-filter.html)(Communications Toolbox) +[用 RRC 滤波器进行插值和抽取](https://ww2.mathworks.cn/help/releases/R2024a/comm/ug/filtering.html#mw_fa589f54-fcad-495e-b4f8-4a4ad52c1f1a)(Communications Toolbox) -> 原文参考:[https://ww2.mathworks.cn/help/signal/ref/rcosdesign.html](https://ww2.mathworks.cn/help/signal/ref/rcosdesign.html) +> 原文参考:[https://ww2.mathworks.cn/help/releases/R2024a/signal/ref/rcosdesign.html](https://ww2.mathworks.cn/help/releases/R2024a/signal/ref/rcosdesign.html) diff --git a/source/images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-010-DesignASquareRootRaisedCosineFilterExample-01.png b/source/images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-010-DesignASquareRootRaisedCosineFilterExample-01.png deleted file mode 100644 index db14fa1..0000000 Binary files a/source/images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-010-DesignASquareRootRaisedCosineFilterExample-01.png and /dev/null differ diff --git a/source/images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-010-DesignASquareRootRaisedCosineFilterExample-01.svg b/source/images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-010-DesignASquareRootRaisedCosineFilterExample.svg similarity index 69% rename from source/images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-010-DesignASquareRootRaisedCosineFilterExample-01.svg rename to source/images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-010-DesignASquareRootRaisedCosineFilterExample.svg index b34fa28..b297a09 100644 --- a/source/images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-010-DesignASquareRootRaisedCosineFilterExample-01.svg +++ b/source/images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-010-DesignASquareRootRaisedCosineFilterExample.svg @@ -1,36 +1,40 @@ -05101520Samples-0.100.10.20.30.40.50.6AmplitudeImpulse Response05101520n (samples) diff --git a/source/images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-020-ImpulseResponsesOfNormalAndSquareRootRaisedCosineFiltersExample-01.png b/source/images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-020-ImpulseResponsesOfNormalAndSquareRootRaisedCosineFiltersExample-01.png deleted file mode 100644 index 167d560..0000000 Binary files a/source/images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-020-ImpulseResponsesOfNormalAndSquareRootRaisedCosineFiltersExample-01.png and /dev/null differ diff --git a/source/images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-020-ImpulseResponsesOfNormalAndSquareRootRaisedCosineFiltersExample-01.svg b/source/images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-020-ImpulseResponsesOfNormalAndSquareRootRaisedCosineFiltersExample-01.svg index 2330c7e..862fdc7 100644 --- a/source/images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-020-ImpulseResponsesOfNormalAndSquareRootRaisedCosineFiltersExample-01.svg +++ b/source/images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-020-ImpulseResponsesOfNormalAndSquareRootRaisedCosineFiltersExample-01.svg @@ -1,38 +1,41 @@ -024681012Samples-0.2-0.100.10.20.30.40.50.6AmplitudeImpulse Response024681012n (samples) diff --git a/source/images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-030-ImpulseResponsesOfNormalAndSquareRootRaisedCosineFiltersExample-02.png b/source/images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-030-ImpulseResponsesOfNormalAndSquareRootRaisedCosineFiltersExample-02.png deleted file mode 100644 index 3d68ecb..0000000 Binary files a/source/images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-030-ImpulseResponsesOfNormalAndSquareRootRaisedCosineFiltersExample-02.png and /dev/null differ diff --git a/source/images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-030-ImpulseResponsesOfNormalAndSquareRootRaisedCosineFiltersExample-02.svg b/source/images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-030-ImpulseResponsesOfNormalAndSquareRootRaisedCosineFiltersExample-02.svg index 4c5e67c..b12b537 100644 --- a/source/images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-030-ImpulseResponsesOfNormalAndSquareRootRaisedCosineFiltersExample-02.svg +++ b/source/images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-030-ImpulseResponsesOfNormalAndSquareRootRaisedCosineFiltersExample-02.svg @@ -1,38 +1,42 @@ -024681012Samples-0.2-0.100.10.20.30.40.50.60.7AmplitudeImpulse Response024681012n (samples) diff --git a/source/images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-040-ImpulseResponsesOfNormalAndSquareRootRaisedCosineFiltersExample-03.png b/source/images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-040-ImpulseResponsesOfNormalAndSquareRootRaisedCosineFiltersExample-03.png deleted file mode 100644 index d58cf74..0000000 Binary files a/source/images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-040-ImpulseResponsesOfNormalAndSquareRootRaisedCosineFiltersExample-03.png and /dev/null differ diff --git a/source/images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-040-ImpulseResponsesOfNormalAndSquareRootRaisedCosineFiltersExample-03.svg b/source/images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-040-ImpulseResponsesOfNormalAndSquareRootRaisedCosineFiltersExample-03.svg index 8845d45..edfaa7a 100644 --- a/source/images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-040-ImpulseResponsesOfNormalAndSquareRootRaisedCosineFiltersExample-03.svg +++ b/source/images/post/2020-11-25-matlab-rcosdesign/2020-11-25-matlab-rcosdesign-040-ImpulseResponsesOfNormalAndSquareRootRaisedCosineFiltersExample-03.svg @@ -22,6 +22,7 @@ />1Normalized amplitudeNormalized Amplitude0246810121412