Change Impulse in a 3D Wave Simulation.

Hi! I'm working on a 3D wave propagation project and I've designed an impulse response, but I would like to change it to an audio file source. Problem is, I'm having a hard time conceiving how to do so.
% Desired Impluse
[impulse, fs] = audioread('snare.wav');
% Current Method
u = zeros(nx+1, ny+1, nz+1);
uNext = zeros(nx+1, ny+1, nz+1);
u(floor(nx/2), floor(ny/2), floor(nz/2)) = 1; % Impulse
u((3:9), (3:9), (3:9)) = hann3D(7); % Displacement
uPrev = u;
% 3D Wave Equation
uNext(x,y,z) = (2 * u(x,y,z) - uPrev(x,y,z) ...
+ lambdaSq * (u(x+1,y,z) + u(x,y+1,z) + u(x,y,z+1)...
- 6*u(x,y,z) + u(x-1,y,z) + u(x,y-1,z) + u(x,y,z-1)));
Please let me know if you need the full code to understand what I'm attempting to do.

Réponses (0)

Catégories

En savoir plus sur Audio Processing Algorithm Design dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by