var subwooferjs = require("subwooferjs");
var round = require("round");
// compare two enclosures with the same driver
var RockfordP2D212 = new subwooferjs.driver(0.52, 81.5, 26, 13.3, 570, "12 inch round");
// 56 liters ported, or about 2cf, tuned to 35hz
var portedSubwoofer = new subwooferjs.subwoofer(RockfordP2D212, new subwooferjs.enclosure(56, 35));
// 28 liters sealed, or about 1cf
var sealedSubwoofer = new subwooferjs.subwoofer(RockfordP2D212, new subwooferjs.enclosure(28));
var f = 10;
var bandwidth = 3; // make this bigger for more detail
var responsecurves = []
while(f<200){
portedDb = round(portedSubwoofer.frequencyResponse(f), 0.1);
sealedDb = round(sealedSubwoofer.frequencyResponse(f), 0.1);
responsecurves.push({f, portedDb, sealedDb});
f = round(f * Math.pow(2, 1/bandwidth), 0.1);
}
console.log(responsecurves);
Created from: https://npm.runkit.com/subwooferjs/src/subwoofer.js?t=1560574818758&fbclid=IwAR34fSUwR2cqLCu5I04ZhHAFy6MeDdRNGoOrAKD6seKFS0IfonrRC4sz-mQ