Filter löschen
Filter löschen

Sum function discrite time

1 Ansicht (letzte 30 Tage)
alp onur karacay
alp onur karacay am 18 Mär. 2021
Kommentiert: Walter Roberson am 19 Mär. 2021
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 Kommentar
Walter Roberson
Walter Roberson am 19 Mär. 2021
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))

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Mathieu NOE
Mathieu NOE am 19 Mär. 2021
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);

Kategorien

Mehr zu Audio I/O and Waveform Generation finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by