src/apu/apu.cc
/*
 * Applys the NES's audio filters to the sample. These consist of a 90Hz
 * High pass filter, a 440Hz High pass filter, and a 14KHz low pass filter.
 */
Applys the NES's audio filters to the sample. These consist of a 90Hz
High pass filter, a 440Hz High pass filter, and a 14KHz low pass filter.
Applys the NES ' s audio filters to the sample . These consist of a 90Hz High pass filter a 440Hz High pass filter and a 14KHz low pass filter .
float Apu::FilterNextSample(float sample) {
  float sample_temp = HPF1_SMOOTH * (last_hpf1_sample_ + sample
                                  - last_normal_sample_);
  last_normal_sample_ = sample;
  sample = HPF2_SMOOTH * (last_hpf2_sample_ + sample_temp
                       - last_hpf1_sample_);
  last_hpf1_sample_ = sample_temp;
  last_hpf2_sample_ = sample;
  sample_temp = (LPF_SMOOTH * sample)
              + ((1.0 - LPF_SMOOTH) * last_lpf_sample_);
  last_lpf_sample_ = sample_temp;
  return sample_temp;
}
float Apu :: FilterNextSample ( float sample ) { float sample_temp = HPF1_SMOOTH * ( last_hpf1_sample_ + sample - last_normal_sample_ ) ; last_normal_sample_ = sample ; sample = HPF2_SMOOTH * ( last_hpf2_sample_ + sample_temp - last_hpf1_sample_ ) ; last_hpf1_sample_ = sample_temp ; last_hpf2_sample_ = sample ; sample_temp = ( LPF_SMOOTH * sample ) + ( ( 1.0 - LPF_SMOOTH ) * last_lpf_sample_ ) ; last_lpf_sample_ = sample_temp ; return sample_temp ; }
Applys the NES's audio filters to the sample.
Applys the NES ' s audio filters to the sample .
// Apply the first high pass filter (90Hz). // Apply the second high pass filter (440Hz). // Apply the low pass filter (14KHz).