⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 singleecho.m

📁 DSP matlab 实现的很有用的程序
💻 M
字号:
%Delay Function
% y =  singleecho(x, R, a);
% 
% Parameters:
%  x is the input audio signal
%  R is the delay in number of samples
%  a specifies the attenuation in the echo
%
% Return value:
%  y is the output signal
%
% Copyright 2004 Vincent Wan
% Credits: Vikas Sahdev, Rajesh Samudrala, Rajani Sadasivam
%
% Example:
%  [x,fs,nbits] = wavread('dsp01.wav');
%  y = singleecho(x,8000,0.5);
%  wavplay(y,fs);

function y =  singleecho(x, R, a);
xlen=length(x); %Calc. the number of samples in the file 

y=zeros(size(x)); 

% filter the signal 

for i=1:1:R+1
   y(i) = x(i);
end

for i=R+1:1:xlen 
  y(i)= x(i)+ a*x(i-R); 
end;



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -