Initial commit
This commit is contained in:
35
bin/app.php
Normal file
35
bin/app.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
// http://enjoythemusic.com/diy/0311/crossover.htm
|
||||
|
||||
use Scientific\Frequency;
|
||||
use Scientific\Impedance;
|
||||
|
||||
require_once __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
$frequency = new Frequency(unit(9000));
|
||||
$tweeter = new Driver(new Impedance(unit(8)));
|
||||
$woofer = new Driver(new Impedance(unit(4)));
|
||||
|
||||
$crossover = new FirstOrderTwoWayCrossover($frequency);
|
||||
$capacitor = $crossover->getTweeterCapacitor($tweeter);
|
||||
$inductor = $crossover->getWooferInductor($woofer);
|
||||
|
||||
printf(
|
||||
'First order 2-way crossover @ %s (slope = %s):%s',
|
||||
$crossover->getFrequency(),
|
||||
$crossover->getSlope(),
|
||||
PHP_EOL
|
||||
);
|
||||
printf(
|
||||
' - %s capacitor in series with %s tweeter%s',
|
||||
$capacitor->getCapacitance(),
|
||||
$tweeter->getImpedance(),
|
||||
PHP_EOL
|
||||
);
|
||||
printf(
|
||||
' - %s inductor in series with %s woofer%s',
|
||||
$inductor->getInductance()->format('milli'),
|
||||
$woofer->getImpedance(),
|
||||
PHP_EOL
|
||||
);
|
||||
Reference in New Issue
Block a user