matlab谐波生成方法

常见的谐波生成公式有:

参看论文:
1.PERCEPTUALLY-MOTIVATED OBJECTIVE GRADING OF NONLINEAR PROCESSING IN VIRTUAL BASS SYSTEMS
2.Harmonic and Intermodulation Analysis of Nonlinear Devices Used in Virtual Bass Systems
具体的matlab代码为
function Ha = calculate_harmonics()
[d , sr] = wavread('110hz.wav');
% full-wave rectifier NLD transfer function , y = |x|
y = abs(d);
% 论文中的公式
y_poly = 1.307 * d.^6 - 2.6593 * d.^4 + 2.2781 * d.^2 + 0.0838;
% soft clipping y = x/(K|x|+1),K=1
K = 1;
y_soft = d./(K
abs(d)+1);
function my_plot(data)
N = length(data);
xdft = fft(data);
xdft = xdft(1:N/2+1);
freq = 0:sr/N:sr/2;
plot(freq, (2/N)*abs(xdft))
end
subplot(411)
my_plot(d)
subplot(412)
my_plot(y)
subplot(413)
my_plot(y_poly)
subplot(414)
my_plot(y_soft)
end
测试结果为

posted @ 2020-07-17 15:02  繁华如梦个人笔记  阅读(2654)  评论(0编辑  收藏  举报