导航:首页 > 源码编译 > MATLAB深度语音源码

MATLAB深度语音源码

发布时间:2023-05-24 07:33:52

Ⅰ matlab 源代码

%后边不都是已经加注释了吗?
不了解应用情况,解答这个代码很难的。
推荐:
www.ilovematlab.com!
论坛版主很强!

Ⅱ 求matlab源代码

z=0:0.1:1000;

N=length(z);

dz=cos(0.8*z)+cos(0.5*z);

fz=sign(dz);

y=abs(fft(fz))/N;

x=(0:N-1)*2*pi/1000;

yy=y(1:floor(N/2)+1)*2;

xx=x(1:floor(N/2)+1);


[pks locs] = findpeaks(yy(xx<=1),'minpeakheight',0.01);


plot(xx,yy,'k');

set(gca,'Xlim',[0 1]);

ylabel('弊禅Fourier Coeffcient');

xlabel('Reciprocal Vectros');

for ii=1:length(pks);

亩慧 text(xx(locs(ii)),pks(ii),num2str(xx(locs(ii)),'%.2f'),'Rotation'迅卜答,90);

end


Ⅲ 关于一个MATLAB源代码

你这个是普罗克斯或者译为普罗金斯的现代通信系统使用matlab一书上的吧。这个是多幅度信号仿真。使用的的是蒙特卡罗仿真方法,就是用很多次实验的到的结果仿真理论值,容易理解的就是投10000次硬币,5005次整,4995次反,等到正的概率与反的概率。
Function[p]=smldPe58(snr_in_dB) 函数名,输入变量时信噪比dB形式的
d=1; 这李简袜里表示电信号幅度,一个单位
SNR=exp(snr_in_dB*log(10)/10); 将信噪比化成正常的形式,dB你哪激知道吧
Sgma=sqrt((5*d^2)/(4*SNR)); 噪声咐烂标准差,出自理论公式
N=10000; 实验次数
for i=1:N,
temp=rand; 产生一个随机数0-1的
if(temp<0.25), 因为这里仿真四种电平,且认为出现概率相同
dsource(i)=0: 0-0.25是0
elseif(temp<0.5),
dsource(i)=1; 0.25-0.5是1
elseif(temp<0.75),
dsource(i)=2 0.5-0.75是2
else
dsource=3 0.75-1是3刚好四种
end
end;
numoferr=0; 这是个计数器,积累错误个数
for i=1:N,
if(dsource(i)==0),
r=-3*d+gngauss(sgma); 这里把四种电平对应了四种幅度
elseif(dsource(i)==1), -3*d -d d 3*d 间隔2d是信号大小
r=-d+gngauss(sgma); gngauss函数在该书前几章有
elseif(dsuorce(i)==2), 产生高斯分布噪声,
r=d+gngauss(sgma); 这里就是信号加噪声,相当于信号
else 通过信道
r=3*d+gngauss(sgma);
end:
if(r<-2*d), 这里相当于到了接受端,
decis=0; 按接收大小来判决属于0.1.2.3哪种信号
elseif(r<0),
decis=1;
elseif(r<2*d),
decis=2;
elseif
decis=3;
end;
if(decis=dsource(i)), 判决信号和发送的原始信号比较
numoferr=numoferr+1; 不一样就说明错了一个,误码1
end;
end;
p=numoferr/N; 错了多少除以总数,误码率

Ⅳ matlab源代码

hrollfcoef这个函数不是matlab自带的

function [xh] = hrollfcoef(irfn,ipoint,sr,alfs,ncc)

%****************** variables *************************
% irfn : Number of symbols to use filtering
% ipoint : Number of samples in one symbol
% sr : symbol rate
% alfs : rolloff coeficiense
% ncc : 1 -- transmitting filter 0 -- receiving filter
% *****************************************************

xi=zeros(1,irfn*ipoint+1);
xq=zeros(1,irfn*ipoint+1);

point = ipoint;
tr = sr ;
tstp = 1.0 ./ tr ./ ipoint;
n = ipoint .* irfn;
mid = ( n ./ 2 ) + 1;
sub1 = 4.0 .* alfs .* tr; % 4*alpha*R_s

for i = 1 : n

icon = i - mid;
ym = icon;

if icon == 0.0
xt = (1.0-alfs+4.0.*alfs./pi).* tr; % h(0)
else
sub2 =16.0.*alfs.*alfs.*ym.*ym./ipoint./ipoint;
if sub2 ~= 1.0
x1=sin(pi*(1.0-alfs)/ipoint*ym)./pi./(1.0-sub2)./ym./tstp;
x2=cos(pi*(1.0+alfs)/ipoint*ym)./pi.*sub1./(1.0-sub2);
xt = x1 + x2; % h(t) plot((1:length(xh)),xh)
else % (4alphaRst)^2 = 1plot((1:length(xh)),xh)
xt = alfs.*tr.*((1.0-2.0/pi).*cos(pi/4.0/alfs)+(1.0+2.0./pi).*sin(pi/4.0/alfs))./sqrt(2.0);
end % if sub2 ~= 1.0
end % if icon == 0.0

if ncc == 0 % in the case of receiver
xh( i ) = xt ./ ipoint ./ tr; % normalization
elseif ncc == 1 % in the case of transmitter
xh( i ) = xt ./ tr; % normalization
else
error('ncc error');
end % if ncc == 0

end % for i = 1 : n

%******************** end of file ***************************

网上找的,你看看能不能拼到你那个程序里去

Ⅳ matlab采集语音信号后进行PCM编码然后卷积编码进行差错控制的以及反演的源代码!

1.PCM 编码实滚简现(M函数)

function code=PCMcoding(Range,S)
code=zeros(1,8);
Normalization=abs(S)/Range;
deta=1/2048;
if sign(S)==1
code(1)=1;
else
code(1)=0;
end
detas=ceil(Normalization/deta);
if detas>128
code(2)=1;
if detas>512
code(3)=1;
if detas>1024
code(4)=1;
end
elseif detas>256
code(4)=1;
end
elseif detas>32
code(3)=1;
if detas>64
code(4)=1;
end
elseif detas>16
code(4)=1;
end

Tribal=bin2dec(num2str(code(2:4)))+1;
if Tribal==1
Interval=1;
else Interval=(2^(Tribal+2))/16;
end
if Tribal==1
code(5)=(2^3)*Interval<detas;
code(6)=code(5)*(2^3)*Interval+(2^2)*Interval<detas;
code(7)=code(5)*(2^3)*Interval+code(6)*(2^2)*Interval+(2^1)*Interval<橘带detas;
code(8)=code(5)*(2^3)*Interval+code(6)*(2^2)*Interval+code(7)*(2^1)*Interval+(2^0)*Interval<detas;
else
code(5)=2^(Tribal+2)+(2^3)*Interval<detas;
code(6)=2^(Tribal+2)+code(5)*(2^3)*Interval+(2^2)*Interval<detas;
code(7)=2^(Tribal+2)+code(5)*(2^3)*Interval+code(6)*(2^2)*Interval+(2^1)*Interval<detas;
code(8)=2^(Tribal+2)+code(5)*(2^3)*Interval+code(6)*(2^2)*Interval+code(7)*(2^1)*Interval+(2^0)*Interval<detas;
end

2。PCM 解码实现(M函数)大伍裤

%PCM Decoding
function S=PCMdecoding(Range,code)
deta=Range/2048;
Tribal=bin2dec(num2str(code(2:4)))+1;
if Tribal==1
Interval=1;
else Interval=(2^(Tribal+2))/16;
end
if Tribal==1
S=code(5)*(2^3)*Interval+code(6)*(2^2)*Interval+code(7)*(2^1)*Interval+code(8)*(2^0)*Interval+Interval;
else
S=2^(Tribal+2)+code(5)*(2^3)*Interval+code(6)*(2^2)*Interval+code(7)*(2^1)*Interval+code(8)*(2^0)*Interval+Interval;
end
S=S*deta;

Ⅵ 用Matlab语言编写一个语音信号或图象信号去噪的程序请高手帮忙

不好意思,没看到维纳滤波,程序罩唯就不删了

%谱减法语音增强
%输入参数轿闷滚s 语音数据,fs 采样频率,p 下面有说明,共11个,可不输入,有默认值
%“过度减法(oversubtraction)”作减法的时候,保留一小部分原来的背景噪音,用这部分背景噪音来掩盖住音乐噪音的谱峰,从而消除了令人不悦的音乐噪音。

%通过给闭余的参数p,估计噪音,做谱减法。从而消除噪音。
function [ss,po]=specsubm(s,fs,p)
%利用频谱相减(spectral subtraction)增强 [SS,PO]=(S,FS,P)
%
% implementation of spectral subtraction algorithm by R Martin (rather slow)
% algorithm parameters: t* in seconds, f* in Hz, k* dimensionless
% 1: tg = smoothing time constant for signal power estimate (0.04): high=reverberant, low=musical
% 2: ta = smoothing time constant for signal power estimate
%

used in noise estimation (0.1)
% 3: tw = fft window length (will be rounded up to 2^nw samples)
% 4: tm = length of minimum filter (1.5): high=slow response to noise increase, low=distortion
% 5: to = time constant for oversubtraction factor (0.08)
% 6: fo = oversubtraction corner frequency (800): high=distortion, low=musical
% 7: km = number of minimisation buffers to use (4): high=waste memory, low=noise molation
% 8: ks = oversampling constant (4)
% 9: kn = noise estimate compensation (1.5)
% 10:kf = subtraction floor (0.02): high=noisy, low=musical
% 11:ko = oversubtraction scale factor (4): high=distortion, low=musical

%检查函数的输入参数,如果输入少于三个,po为默认值,po的参数上面有说明
if nargin<3 po=[0.04 0.1 0.032 1.5 0.08 400 4 4 1.5 0.02 4].'; else po=p; end

ns=length(s);
ts=1/fs;
ss=zeros(ns,1);

ni=pow2(nextpow2(fs*po(3)/po(8)));
ti=ni/fs;
nw=ni*po(8);
nf=1+floor((ns-nw)/ni);
nm=ceil(fs*po(4)/(ni*po(7)));

win=0.5*hamming(nw+1)/1.08;win(end)=[];
zg=exp(-ti/po(1));
za=exp(-ti/po(2));
zo=exp(-ti/po(5));

px=zeros(1+nw/2,1);
pxn=px;
os=px;
mb=ones(1+nw/2,po(7))*nw/2;
im=0;
osf=po(11)*(1+(0:nw/2).'*fs/(nw*po(6))).^(-1);

imidx=[13 21]';
x2im=zeros(length(imidx),nf);
osim=x2im;
pnim=x2im;
pxnim=x2im;
qim=x2im;

for is=1:nf
idx=(1:nw)+(is-1)*ni;
x=rfft(s(idx).*win);
x2=x.*conj(x);

pxn=za*pxn+(1-za)*x2;
im=rem(im+1,nm);
if im

mb(:,1)=min(mb(:,1),pxn);
else

mb=[pxn,mb(:,1:po(7)-1)];
end
pn=po(9)*min(mb,[],2);
%os= oversubtraction factor
os=zo*os+(1-zo)*(1+osf.*pn./(pn+pxn));

px=zg*px+(1-zg)*x2;
q=max(po(10)*sqrt(pn./x2),1-sqrt(os.*pn./px));

ss(idx)=ss(idx)+irfft(x.*q);

end
if nargout==0
soundsc([s; ss],fs);
end

Ⅶ MATLAB 语音信号处理

1.改变声音播放速度
所谓改变声音的播放速度也就是改变采样间隔(sampling interval)(即改变衫闹了采样频率),但是这个频率依然要在2f(Nyquist rate)之上简塌乱,否则就会产生失真(distortion)。

2.实现对声音信号放大和衰减功能
所谓放大或者衰减并不改变声音信号频域上的特征,只改变时域上的幅值,这时就需要全通滤波器(all pass filter)拦档然后加一个固有的参数。改变参数可以实现对声音信号放大和衰减功能

3.实现混音音效效果
所谓混音就是不同的声音叠加在一起,而又不影响分别的时域和频域的特征。

4.实现回音音效效果
回声在时域上幅值减小了,频域上的特征不变,只需要把原信号添加一个延时(delay)和对时域的幅度(Amplitude)添加一个参数(coefficient).然后和原信号叠加(同三)。

5.实现男女变声音效效果
男女变音就是需要改变频域的幅度,但是是线性的改变幅度。

阅读全文

与MATLAB深度语音源码相关的资料

热点内容
linux命令cpu使用率 浏览:65
linux实用命令 浏览:236
传奇引擎修改在线时间命令 浏览:107
php取域名中间 浏览:896
cad命令栏太小 浏览:830
php开发环境搭建eclipse 浏览:480
qt文件夹名称大全 浏览:212
金山云服务器架构 浏览:230
安卓系统笔记本怎么切换系统 浏览:618
u盘加密快2个小时还没有搞完 浏览:93
小米有品商家版app叫什么 浏览:94
行命令调用 浏览:436
菜鸟裹裹员用什么app 浏览:273
穷查理宝典pdf下载 浏览:514
csgo您已被禁用此服务器怎么办 浏览:398
打开加密软件的方法 浏览:156
云存储服务器可靠吗 浏览:967
2核1g的云服务器能带动游戏嘛 浏览:898
逆命20解压码 浏览:146
徐州办犬证需要下载什么app 浏览:1002