1
下面是代碼:MATLAB - 矩陣尺寸必須同意(儘管它們是 「同意」!)
fs = 22050;
x = rand(fs,1);
x = x - mean(x); % get rid of DC offeset
% set comb-filter coefficients
f = 220; % fundamental
L = round(fs/f); % delay length
coef = 0.99; % IIR coefficient
% build delay vector and filter
b = [1 zeros(1,L-1) coef];
y = filter(1, b, x);
% create amplitude envelope for output
decay = 8;
expEnv = exp ((0:(length(y)-1))/length(y));
expEnv = (1./expEnv).^ decay;
fprintf('%d\n',length(expEnv));
fprintf('%d\n', length(y));
% envelope output signal
z = y .* expEnv;
sound(z , fs); % play sound
它拒絕執行Z = Y * expEnv線。 printf行顯示y和expEnv都具有相同的長度(22050)
是的,轉!這樣的搖滾錯誤:) –
「搖滾錯誤」。大聲笑 – learnvst