%========================================================================== % Diffn_Circ_Aperture_Thy.m % % Fraunhofer diffraction through a circular aperture - simplest theory % - far-field/plane-wave approx! % Sound waves assumed to be propagating in free air/great wide-open! % %========================================================================== % % Written by Prof. Steven Errede Last Updated: Feb. 7, 2011 12:25 hr % %========================================================================== close all; clear all; single thtr(1800); single thtd(1800); single Itot1(1800); single SIL1(1800); single yscr(2000); single Itot2(2000); single SIL2(2000); single Itotxy(2000,2000); %single LgItotxy(2000,2000); single SILxy(2000,2000); % Specify numerical values of parameters: Io = 1.0; % intensity from single slit (Watts/m^2) Ir = 1.0*10^-12;% reference sound intensity (Watts/m^2) Vair = 343.0; % speed of propagation of sound - free air (m/s) freq = 1000.0; % frequency (Hz or cps) lambda = Vair/freq; % wavelength (m) Lobs = 10.0; % observer distance (m) n.b. lambda << Lobs % Specify the aperture radius (m): Rapr = 1.0; % 0.1; 1.0; aperture radius (m) n.b. Rapr << Lobs nu = 1; % order of bessel function of 1st kind (see below) %=================================== % Calculate Itot vs. theta: %=================================== Thetad = -90.0; % angle theta of observer in degrees dTheta = 0.1; % step angle in degrees for i = 1:1800; thtd(i) = Thetad; % angle theta of observer in degrees Thetar = (pi/180.0)*Thetad; % angle theta of observer in radians thtr(i) = Thetar; rho = ((2.0*pi*Rapr)/lambda)*sin(Thetar); % phase (radians) Itot1(i) = Io*((2.0*bessel(nu,rho))/rho)^2; % total intensity (Watts/m^2) SIL1(i) = 10.0*log10(Itot1(i)/Ir); % Sound Intensity Level (dB) Thetad = Thetad + dTheta; % increment angle for next calculation end figure(01); plot(thtd,Itot1,'b'); grid on; xlabel('theta (degrees)'); ylabel('Intensity (Watts/m^{2})'); title('Intensity vs. theta'); figure(02); semilogy(thtd,Itot1,'b'); grid on; xlabel('theta (degrees)'); ylabel('Intensity (Watts/m^{2})'); title('Log10 Intensity vs. theta'); figure(03); plot(thtd,SIL1,'b'); grid on; xlabel('theta (degrees)'); ylabel('SIL (dB)'); title('SIL vs. theta'); figure(04); polar(thtr,SIL1,'b'); grid on; xlabel('theta (degrees)'); ylabel('SIL (dB)'); title('Polar plot of SIL vs. theta'); %=================================== % Calculate Itot vs. yscreen: %=================================== y = -50.00; % starting position on screen (m) dy = 0.05; % step size on screen (m); for i = 1:2000; yscr(i) = y; % position of observer on perp. screen (m) Thetar = atan(y/Lobs); % angle theta of observer in radians rho = ((2.0*pi*Rapr)/lambda)*sin(Thetar); % phase (radians) Itot2(i) = Io*((2.0*bessel(nu,rho))/rho)^2; % total intensity (Watts/m^2) SIL2(i) = 10.0*log10(Itot2(i)/Ir); % Sound Intensity Level (dB) y = y + dy; % increment screen position for next calculation end figure(11); plot(yscr,Itot2,'b'); grid on; xlabel('Yscreen (m)'); ylabel('Intensity (Watts/m^{2})'); title('Intensity vs. Yscreen'); figure(12); semilogy(yscr,Itot2,'b'); grid on; xlabel('Yscreen (m)'); ylabel('Intensity (Watts/m^{2})'); title('Log10 Intensity vs. Yscreen'); figure(13); plot(yscr,SIL2,'b'); grid on; xlabel('Yscreen (m)'); ylabel('SIL (dB)'); title('SIL vs. Yscreen'); %========================================================================== beep; fprintf('\n Very CPU-intensive I(x,y) vs. x,y calcs - please be patient!! \n') %========================================================================== %======================================== % Calculate 2D Itot vs. x,y-screen: %======================================== x = -50.00; % x-starting position on screen (m) dx = 0.05; % x-step size on screen (m); for j = 1:2000; xscr(j) = x; % x-position of observer on perp. screen (m) y = -50.00; % y-starting position on screen (m) dy = 0.05; % y-step size on screen (m); for i = 1:2000; yscr(i) = y; % y-position of observer on perp. screen (m) rscr = sqrt((xscr(j))^2 + (yscr(i))^2); % radial pos'n on perp. screen (m) Thetar = atan(rscr/Lobs); % angle theta of observer in radians rho = ((2.0*pi*Rapr)/lambda)*sin(Thetar); % phase (radians) Itotxy(j,i) = Io*((2.0*bessel(nu,rho))/rho)^2; % total intensity (Watts/m^2) LgItotxy(j,i) = log10(Itotxy(j,i)); % log10 of total intensity (Watts/m^2) SILxy(j,i) = 10.0*log10(Itotxy(j,i)/Ir); % Sound Intensity Level (dB) y = y + dy; % increment y-screen position for next calculation end x = x + dx; % increment x-screen position for next calculation end figure(21); surf(xscr,yscr,Itotxy); shading interp; xlabel('Xscreen (m)'); ylabel('Yscreen (m)'); zlabel('Intensity (Watts/m^{2})'); title ('Intensity vs. Xscreen-Yscreen'); %figure(22); %surf(xscr,yscr,LgItotxy); %shading interp; %xlabel('Xscreen (m)'); %ylabel('Yscreen (m)'); %zlabel('Log10(Intensity) (Watts/m^{2})'); %title ('Log10(Intensity) vs. Xscreen-Yscreen'); figure(23); surf(xscr,yscr,SILxy); shading interp; xlabel('Xscreen (m)'); ylabel('Yscreen (m)'); zlabel('SIL (dB)'); title ('SIL vs. Xscreen-Yscreen'); %========================================================================== beep; fprintf('\n Calculation of diffraction through circular aperture completed !!! \n') %==========================================================================