Implement community forum integration in CommunityPage; update BottomNav to conditionally display community tab based on screen size. Add new audio processing function for combined PEQ magnitude calculation in peqAudio.
This commit is contained in:
@@ -359,6 +359,26 @@ export function computePeqMagnitudeDb(bands: PeqBandForResponse[], fs: number):
|
||||
return getFreqznList(list, fs, f);
|
||||
}
|
||||
|
||||
/**
|
||||
* 级联后总幅度(dB)在某一频率上的值,与 {@link computePeqMagnitudeDb} / 黄线 EQ 曲线同源。
|
||||
* 用于把 10 个拖拽点画在曲线上(曲线为各带合成响应,不能再用单带的 gain 参数当纵坐标)。
|
||||
*/
|
||||
export function sampleCombinedPeqMagnitudeDb(
|
||||
bands: PeqBandForResponse[],
|
||||
freq: number,
|
||||
fs: number = 48000,
|
||||
): number {
|
||||
const fc = Math.max(20, Math.min(20000, freq));
|
||||
const list: Coeff[] = [];
|
||||
bands.forEach((b) => {
|
||||
if (!b.enabled) return;
|
||||
list.push(getSectionsMatrix(b.gain, b.freq, b.q, getFilterType(b.type), false, fs));
|
||||
});
|
||||
if (list.length === 0) return 0;
|
||||
const out = getFreqznList(list, fs, [fc]);
|
||||
return out[0] ?? 0;
|
||||
}
|
||||
|
||||
export type PeqSvgCurveData = {
|
||||
points: Array<{ x: number; y: number; gainDb: number; freq: number }>;
|
||||
pathD: string;
|
||||
|
||||
Reference in New Issue
Block a user