本文最后更新于 2022-05-15T17:37:15+08:00
验证上采样
理论
上采样:
给原始\(f_s\)采样点后面补零(补up_rate-1个零)
等同于给原始信号(假设是模拟信号)乘上一个采样向量: \[
\delta = \left[1, \underbrace{0,0,\cdots}_{(\text{up-rate}-1)个\text{0}},1,\underbrace{0,0,\cdots}_{(\text{up-rate}-1)个\text{0}}\right]
\] 根据于采样定理,频谱会以\(f_s\)为周期进行搬移。

实验验证
Result



code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| clc;clear;close all; f = 1e2; fs = 1e3; N = 1000; t = (0:N-1)/fs;
y = sin(2*pi*f*t+randn*2*pi);
figure(1) subplot(211) plot(t, y) subplot(212) plot((-N/2:(N-1)/2)/N*fs, fftshift(abs(fft(y)))); suptitle('原始信号')
up_rate = 10; y_up_sample = reshape([y;zeros(up_rate-1, N)], 1, up_rate*N);
N = length(y_up_sample); figure(2) subplot(211) plot( y_up_sample) subplot(212) plot((-N/2:(N-1)/2)/N*fs*up_rate, fftshift(abs(fft(y_up_sample)))); suptitle('10倍插值(插9个0)')
sps = up_rate; span = 6; h = rcosdesign(0.35, span, sps); y_after_rcos = filter(h, 1, y_up_sample); figure(3) subplot(211) plot(y_after_rcos) subplot(212) plot((-N/2:(N-1)/2)/N*fs*up_rate, fftshift(abs(fft(y_after_rcos)))); suptitle('成型滤波后的结果')
|