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.
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Audio Processing Algorithm Design에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!