mirror of
https://github.com/radio95-rnt/fm95.git
synced 2026-02-27 03:23:54 +01:00
turn lpf and emphasis into a common rc
This commit is contained in:
@@ -122,9 +122,9 @@ int main() {
|
||||
Oscillator osc;
|
||||
init_oscillator(&osc, 50000.0, SAMPLE_RATE);
|
||||
#ifdef PREEMPHASIS
|
||||
Emphasis preemp_l, preemp_r;
|
||||
init_emphasis(&preemp_l, PREEMPHASIS_TAU, SAMPLE_RATE);
|
||||
init_emphasis(&preemp_r, PREEMPHASIS_TAU, SAMPLE_RATE);
|
||||
ResistorCapacitor preemp_l, preemp_r;
|
||||
init_rc(&preemp_l, PREEMPHASIS_TAU, SAMPLE_RATE);
|
||||
init_rc(&preemp_r, PREEMPHASIS_TAU, SAMPLE_RATE);
|
||||
#endif
|
||||
#ifdef LPF
|
||||
LowPassFilter lpf_l, lpf_r;
|
||||
|
||||
@@ -104,8 +104,8 @@ int main() {
|
||||
}
|
||||
|
||||
#ifdef PREEMPHASIS
|
||||
Emphasis preemp;
|
||||
init_emphasis(&preemp, PREEMPHASIS_TAU, SAMPLE_RATE);
|
||||
ResistorCapacitor preemp;
|
||||
init_rc(&preemp, PREEMPHASIS_TAU, SAMPLE_RATE);
|
||||
#endif
|
||||
#ifdef LPF
|
||||
LowPassFilter lpf;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// #define PREEMPHASIS
|
||||
#define PREEMPHASIS
|
||||
// #define LPF
|
||||
|
||||
#define buffer_maxlength 12288
|
||||
|
||||
@@ -121,9 +121,9 @@ int main() {
|
||||
Oscillator stereo_osc;
|
||||
init_oscillator(&stereo_osc, 31250.0, SAMPLE_RATE);
|
||||
#ifdef PREEMPHASIS
|
||||
Emphasis preemp_l, preemp_r;
|
||||
init_emphasis(&preemp_l, PREEMPHASIS_TAU, SAMPLE_RATE);
|
||||
init_emphasis(&preemp_r, PREEMPHASIS_TAU, SAMPLE_RATE);
|
||||
ResistorCapacitor preemp_l, preemp_r;
|
||||
init_rc(&preemp_l, PREEMPHASIS_TAU, SAMPLE_RATE);
|
||||
init_rc(&preemp_r, PREEMPHASIS_TAU, SAMPLE_RATE);
|
||||
#endif
|
||||
#ifdef LPF
|
||||
LowPassFilter lpf_l, lpf_r;
|
||||
|
||||
@@ -112,8 +112,8 @@ int main() {
|
||||
FMModulator mod;
|
||||
init_fm_modulator(&mod, FREQUENCY, DEVIATION, SAMPLE_RATE);
|
||||
#ifdef PREEMPHASIS
|
||||
Emphasis preemp;
|
||||
init_emphasis(&preemp, PREEMPHASIS_TAU, SAMPLE_RATE);
|
||||
ResistorCapacitor preemp;
|
||||
init_rc(&preemp, PREEMPHASIS_TAU, SAMPLE_RATE);
|
||||
#endif
|
||||
#ifdef LPF
|
||||
LowPassFilter lpf;
|
||||
|
||||
@@ -128,9 +128,9 @@ int main() {
|
||||
DelayLine monoDelay;
|
||||
init_delay_line(&monoDelay, 99);
|
||||
#ifdef PREEMPHASIS
|
||||
Emphasis preemp_l, preemp_r;
|
||||
init_emphasis(&preemp_l, PREEMPHASIS_TAU, SAMPLE_RATE);
|
||||
init_emphasis(&preemp_r, PREEMPHASIS_TAU, SAMPLE_RATE);
|
||||
ResistorCapacitor preemp_l, preemp_r;
|
||||
init_rc(&preemp_l, PREEMPHASIS_TAU, SAMPLE_RATE);
|
||||
init_rc(&preemp_r, PREEMPHASIS_TAU, SAMPLE_RATE);
|
||||
#endif
|
||||
#ifdef LPF
|
||||
LowPassFilter lpf_l, lpf_r;
|
||||
|
||||
@@ -122,9 +122,9 @@ int main() {
|
||||
Oscillator pilot_osc;
|
||||
init_oscillator(&pilot_osc, 19000.0, SAMPLE_RATE); // Pilot, it's there to indicate stereo and as a refrence signal with the stereo carrier
|
||||
#ifdef PREEMPHASIS
|
||||
Emphasis preemp_l, preemp_r;
|
||||
init_emphasis(&preemp_l, PREEMPHASIS_TAU, SAMPLE_RATE);
|
||||
init_emphasis(&preemp_r, PREEMPHASIS_TAU, SAMPLE_RATE);
|
||||
ResistorCapacitor preemp_l, preemp_r;
|
||||
init_rc(&preemp_l, PREEMPHASIS_TAU, SAMPLE_RATE);
|
||||
init_rc(&preemp_r, PREEMPHASIS_TAU, SAMPLE_RATE);
|
||||
#endif
|
||||
#ifdef LPF
|
||||
LowPassFilter lpf_l, lpf_r;
|
||||
|
||||
@@ -124,9 +124,9 @@ int main() {
|
||||
init_fm_modulator(&mod_mono, 67000, 6000, SAMPLE_RATE);
|
||||
init_fm_modulator(&mod_stereo, 80000, 6000, SAMPLE_RATE);
|
||||
#ifdef PREEMPHASIS
|
||||
Emphasis preemp_l, preemp_r;
|
||||
init_emphasis(&preemp_l, PREEMPHASIS_TAU, SAMPLE_RATE);
|
||||
init_emphasis(&preemp_r, PREEMPHASIS_TAU, SAMPLE_RATE);
|
||||
ResistorCapacitor preemp_l, preemp_r;
|
||||
init_rc(&preemp_l, PREEMPHASIS_TAU, SAMPLE_RATE);
|
||||
init_rc(&preemp_r, PREEMPHASIS_TAU, SAMPLE_RATE);
|
||||
#endif
|
||||
#ifdef LPF
|
||||
LowPassFilter lpf_l, lpf_r;
|
||||
|
||||
Reference in New Issue
Block a user