希尔伯特变换
matlab代码
% 接收机关于载波频率和初相的信息
ReceiverKnowsCarrier= 'False'; % 如果接收机知道载波频率和初相,则设置为True
% 载波
fc = 200; % 载波频率
beta_c = pi/5; % 载波的初相
% 调制信号
f = 10; % 调制信号频率
alpha = 10; % 调制信号幅度
theta_m = pi/4; % 调制信号的初相
fs = 10 * fc; % 采样频率
duration = 0.3; % 信号持续时间
t = 0:1/fs:duration-1/fs; % 采样时刻序列
m = alpha*sin(2*pi*f*t + theta_m); % 调制信号
% 相位调制
x = cos(2*pi*fc*t + beta_c + m ); % 已调信号
figure();
subplot(3,1,1); plot(t,m, 'LineWidth', 1); grid on; % 绘图调制信号
title('Modulating signal'); xlabel('t'); ylabel('m(t)')
subplot(3,1,2); plot(t,x, 'LineWidth', 1); grid on; % 绘图调制信号
title('Modulated signal'); xlabel('t');ylabel('x(t)')
% AWGN信道传输
nMean = 0; % 噪声均值
nSigma = 0.01; % 噪声标准差
n = nMean + nSigma*randn(size(t)); % awgn噪声
r = x + n; % 带噪接收信号
% 带噪调相信号的解调
% z = hilbert(r); % 生成带噪接收信号的解析信号
z = Generate_analytic_signal(r); % 生成带噪接收信号的解析信号
z = z.'; % 转置不取共轭
inst_phase = unwrap(angle(z)); % 瞬时相位
% 载波瞬时相位
if strcmpi(ReceiverKnowsCarrier,'True') % 接收机完全知道载波频率/相位
offsetTerm = 2*pi*fc*t + beta_c;
else % 接收机不知道载波频率/相位,则估计载波瞬时相位作为减法项
p = polyfit(t,inst_phase,1); % 求载波瞬时相位的线性拟合系数
estimated = polyval(p,t); % 拟合估计载波瞬时相位
offsetTerm = estimated;
end
demodulated = inst_phase - offsetTerm; % 解调
subplot(3,1,3); plot(t,demodulated, 'LineWidth', 1); grid on; % 解调信号
title('Demodulated signal'); xlabel('t'); ylabel('hat m(t) ');
原文
https://blog.csdn.net/weixin_45333185/article/details/143751408?spm=1001.2101.3001.6650.2&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7Ebaidujs_baidulandingword%7ECtr-2-143751408-blog-79366444.235%5Ev43%5Epc_blog_bottom_relevance_base5&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7Ebaidujs_baidulandingword%7ECtr-2-143751408-blog-79366444.235%5Ev43%5Epc_blog_bottom_relevance_base5&utm_relevant_index=5
MATLAB中做信号希尔伯特变换有两条命令
- x = hilbert(xr) x = 希尔伯特 (XR)
- x = hilbert(xr,n)
- x = 希尔伯特 (XR,N)
Description
example
x = hilbert(xr) returns the analytic signal, x, from a real data sequence, xr. If xr is a matrix, then hilbert finds the analytic signal corresponding to each column.
x = hilbert(xr,n) uses an n-point fast Fourier transform (FFT) to compute the Hilbert transform. The input data is zero-padded or truncated to length n, as appropriate.