필터 지우기
필터 지우기

Sum function discrite time

조회 수: 3 (최근 30일)
alp onur karacay
alp onur karacay 2021년 3월 18일
댓글: Walter Roberson 2021년 3월 19일
hello guys, i am beginner, i try to solve this however just did this equation and no more y3 = symsum(x,k,1000,6000);
Thank for your support
  댓글 수: 1
Walter Roberson
Walter Roberson 2021년 3월 19일
In practice, you cannot use symsum() for recursive formulas: if x[n] is defined in terms of x[previous value] then you will need to define the output through iteration. symsum() is only for cases where you can define each individual element according to a formula that can be computed without computing the previous entries.
Also, you can never use a symbolic variable as a subscript, so you cannot use symsum() with subscripting. It is not for example possible to do
X = randi(9, 1, 10);
syms n
symsum(gamma(X(n)), n, 1, 10) %NOT LEGAL
Instead you should take the different definite values and sum them:
sum(gamma(X))

댓글을 달려면 로그인하십시오.

답변 (1개)

Mathieu NOE
Mathieu NOE 2021년 3월 19일
hello
this is an example of echo simulation - please adapt to your parameters
hope it helps
clear all;
close all;
infile='DirectGuitar.wav';
outfile='out_echo.wav';
% read the sample waveform
[x,Fs] = audioread(infile);
% normalize x to +/- 1 amplitude
x = x ./ (max(abs(x)));
% parameters
N_delay=20; % delay in samples
C = 0.7; % amplitude of direct sound
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
y = zeros(length(x),1); % create empty out vector
y(1:N_delay)=x(1:N_delay); % to avoid referencing of negative samples
% for each sample > N_delay
for i = (N_delay+1):length(x)
y(i) = C*x(i) + (1-C)*(x(i-N_delay)); % add delayed sample
end
% write output
% normalize y to +/- 1 amplitude
y = y ./ (max(abs(y)));
audiowrite(outfile, y, Fs);
figure(1)
hold on
plot(x,'r');
plot(y,'b');
title('Echoed and original Signal');
sound(y,Fs);

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by