-
-
Save anonymous/d18e9786acdd9dac888f72436f5ef4e4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%Speaker Tuning | |
%I apologize in advance because this is poorly commented. When I wrote this, I knew what it all meant. | |
%It's now 3 years later and I can't seem to recall what some of this means... I'm sorry. | |
%This is why you should always comment your code with useful information. | |
%Use this site if this is unclear, I believe it uses the same equation: | |
% https://www.ajdesigner.com/phpsubwoofervented/port_length_equation_k.php | |
innerHeight = (8.5*2.54); %cm | |
innerWidth = (6.00*2.54); %cm | |
innerDepth = (8.5*2.54); %cm | |
Fs = 50; %Hz | |
Qts = 0.34; | |
Qms = 6.71; | |
Qes = 0.36; | |
Mms = 10.8; %g | |
Vas = 11.2; %L | |
const = 2.35625e4; | |
innerVol = innerHeight * innerWidth * innerDepth; %cm^3 | |
innerVolLiters = innerVol / 1000; %L | |
portDia = 1.375*2.54; %cm | |
Vb = 20 * Vas * Qts ^ 3.3; %Target Box Volume in liters | |
disp(['Target Volume = ', num2str(Vb); 'Actual Volume = ', num2str(innerVolLiters)]); | |
Fb = Fs * 0.42 * Qts ^(-0.96); %Tune Frequency | |
disp(['Tune to this frequency: ', num2str(Fb), ' Hz']); | |
Lv = (const*(portDia)^2)/(innerVolLiters*Fb^2) - 0.732*portDia; %k = 0.732 because 1 free end and one flanged end | |
disp(['Port length should be: ' num2str(Lv) ' cm!']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment