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
export default function LowpassFilter(Fc) { | |
var Q = 0.707; | |
var K = Math.tan(Math.PI * Fc); | |
var norm = 1 / (1 + K / Q + K * K); | |
this.a0 = K * K * norm; | |
this.a1 = 2 * this.a0; | |
this.a2 = this.a0; | |
this.b1 = 2 * (K * K - 1) * norm; | |
this.b2 = (1 - K / Q + K * K) * norm; |
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
// group of for loops with waiting | |
int m, n; | |
dispatch_group_t group = dispatch_group_create(); | |
dispatch_group_async(group, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH,0), ^{ | |
// before all parallel m | |
dispatch_apply(m, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^(size_t i) { | |
// parallel m code with i for index | |
}); | |
// after all parallel m | |
}); |