声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

12
返回列表 发新帖
楼主: 栗子鱼

[编程技巧] 如何在已有的语音信号中加噪音?

[复制链接]
发表于 2008-3-12 22:35 | 显示全部楼层
我试了试,这个程序还是不能用,还是出现的错误:
??? Error using ==> plus
Matrix dimensions must agree.

Error in ==> Untitled25 at 7
x2=x1+d;
这里x1是2维的,而d是1维的,怎么变一下呀?
回复 支持 反对
分享到:

使用道具 举报

发表于 2009-3-24 15:16 | 显示全部楼层
fs=22050; 
x1=wavread('wavfile');
f=fs*(0:511)/1024;
t=0:1/22050:(size(x1)-1)/22050;    %将所加噪声信号的点数调整到与原始信号相同
Au=0.5;
d=[Au*cos(2*pi*1000*t)]';   %噪声为5kHz的余弦信号
x2=x1+d;
sound(x2,22050);    %播放加噪声后的语音信号
y1=fft(x1,1024);
y2=fft(x2,1024);
figure(1)
plot(t,x2)
title('加噪后的信号');
xlabel('time n');
ylabel('幅值 n');
figure(2)
subplot(2,1,1);
plot(f,abs(y1(1:512)));
title('原始语音信号频谱');
xlabel('Hz');
ylabel('fuzhi');
subplot(2,1,2);
plot(f,abs(y2(1:512)));
title('加噪后的信号频谱');
xlabel('Hz');
ylabel('fuzhi');
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-9-22 19:44 , Processed in 0.055181 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表