?? singleecho.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 + -