mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-03-01 08:17:20 +00:00
Move code into .cpp for tiny code size improvement.
This commit is contained in:
parent
af8c9609a8
commit
20137db8d0
@ -137,5 +137,14 @@ buffer_s16_t FM::execute(
|
|||||||
return { dst.p, src.count, src.sampling_rate };
|
return { dst.p, src.count, src.sampling_rate };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FM::configure(const float sampling_rate, const float deviation_hz) {
|
||||||
|
/*
|
||||||
|
* angle: -pi to pi. output range: -32768 to 32767.
|
||||||
|
* Maximum delta-theta (output of atan2) at maximum deviation frequency:
|
||||||
|
* delta_theta_max = 2 * pi * deviation / sampling_rate
|
||||||
|
*/
|
||||||
|
k = static_cast<float>(32767.0f / (2.0 * pi * deviation_hz / sampling_rate));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -55,14 +55,7 @@ public:
|
|||||||
const buffer_s16_t& dst
|
const buffer_s16_t& dst
|
||||||
);
|
);
|
||||||
|
|
||||||
void configure(const float sampling_rate, const float deviation_hz) {
|
void configure(const float sampling_rate, const float deviation_hz);
|
||||||
/*
|
|
||||||
* angle: -pi to pi. output range: -32768 to 32767.
|
|
||||||
* Maximum delta-theta (output of atan2) at maximum deviation frequency:
|
|
||||||
* delta_theta_max = 2 * pi * deviation / sampling_rate
|
|
||||||
*/
|
|
||||||
k = static_cast<float>(32767.0f / (2.0 * pi * deviation_hz / sampling_rate));
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
complex16_t::rep_type z_ { 0 };
|
complex16_t::rep_type z_ { 0 };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user