GNU Octave:如何计算一组信号的上下包络?

问题描述 投票:0回答:1

我有一组信号(傅立叶级数产生不同的正弦和余弦参数),我想找到这组的上下包络。

傅里叶系列的一个可行的例子是:

%interval length and number of points
L = 2*pi;
N = 60;
%data points
x = (linspace(0,L,N+1))';
s1 = 1*sin(x) + 2*cos(x) + 3*sin(2*x) + 4*cos(2*x);
s2 = 4*sin(x) + 1*cos(x) + 2*sin(2*x) + 3*cos(2*x);
s3 = 3*sin(x) + 4*cos(x) + 1*sin(2*x) + 2*cos(2*x);
#
clf;
plot(x, s1, 'k', x, s2, 'b',  x, s3, 'r' )
#

enter image description here

如何计算出我需要的信封?

signal-processing octave envelope
1个回答
2
投票

感谢@Tasos Papastylianou,我找到了解决方案。将信号值排列在矩阵中并为每行取最小值和最大值就足够了:

#To find envelope: arrange the function values in  matrix
#And take max and min by row
foo = [s1, s2, s3];
env_hi = max(foo,[], 2);
env_low = min(foo, [], 2);
#
clf;
hold on;
plot(x, s1, 'g', x, s2, 'b',  x, s3, 'r' )
plot(x, env_low, 'k^', x, env_hi, 'kv')
legend('s1', 's2', 's3', 'env-low', 'env-hi', 'location', 'north');
#

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.