Audio Effect Generator with Convolution using impulse response

17 Ansichten (letzte 30 Tage)
babavicecity
babavicecity am 23 Okt. 2024
Beantwortet: jibrahim am 25 Okt. 2024
function impulseResponse = createDelayImpulseResponse(app, sampleRate, delayInSeconds, amplitude)
delaySamples = round(delayInSeconds * sampleRate); % Convert delay to samples
impulseResponse = zeros(delaySamples + 1, 1); % Create a zero vector
impulseResponse(1) = amplitude; % Original signal
impulseResponse (delaySamples+1) = 1; %Signal Delayed
end
function impulseResponse = createEchoImpulseResponse(app, sampleRate, delayInSeconds, decayFactor)
delaySamples = round(delayInSeconds * sampleRate);
impulseResponse = zeros(delaySamples, 1);
impulseResponse(1) = 1; % Original signal
impulseResponse(end) = decayFactor; % Echo signal with decay
end
function impulseResponse = createReverbImpulseResponse(app, sampleRate, duration, decayFactor)
delaySamples = round(sampleRate * duration);
impulseResponse = zeros(delaySamples, 1);
% Simulate reverb with several delays
for i = 1:4
impulseResponse(i * round(sampleRate * 0.1)) = decayFactor^(i-1); % Adjust delay and decay
end
end
I use this code then
app.convolvedAudio = conv(app.audioData, impulseResponse)
i get the convolved audio with this.
I am a beginner are these right? Can you suggest me more audio effects?

Antworten (1)

jibrahim
jibrahim am 25 Okt. 2024
Please see the following objects in Audio Toolbox for different audio effects:
  • reverberator: Add reverberation to audio signal
  • audiopluginexample.Chorus: Adds an audio chorus effect. The chorus effect is implemented by modulating two delay lines.
  • audiopluginexample.Echo: Implements an audio echo effect using two delay lines. The plugin user tunes the delay taps in seconds, the gain of the delay taps, and the output dry/wet mix.
  • audiopluginexample.Flanger: Implements an audio flanging effect using a modulated delay line. The plugin user tunes the delay tap in seconds, the amplitude and frequency of the delay line modulation, and the output dry/wet mix.
  • audiopluginexample.Strobe: Implements an audio strobing effect. Tunable parameters of the plugin include the strobe period, the strobe fill, a relative level threshold for implementing the effect, and the ability to synchronize the strobe period with the audio signal dynamics.
See the Audio Plugin Example Gallery for more algorithms.

Kategorien

Mehr zu Audio Processing Algorithm Design finden Sie in Help Center und File Exchange

Produkte


Version

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by