/[svn]/linuxsampler/trunk/src/engines/common/BiquadFilter.h
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/common/BiquadFilter.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2376 by schoenebeck, Sun Oct 14 22:00:17 2007 UTC revision 2377 by schoenebeck, Thu Oct 4 18:16:26 2012 UTC
# Line 3  Line 3 
3   *   LinuxSampler - modular, streaming capable sampler                     *   *   LinuxSampler - modular, streaming capable sampler                     *
4   *                                                                         *   *                                                                         *
5   *   Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck   *   *   Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck   *
6   *   Copyright (C) 2005 - 2007 Christian Schoenebeck                       *   *   Copyright (C) 2005 - 2012 Christian Schoenebeck                       *
7   *                                                                         *   *                                                                         *
8   *   This program is free software; you can redistribute it and/or modify  *   *   This program is free software; you can redistribute it and/or modify  *
9   *   it under the terms of the GNU General Public License as published by  *   *   it under the terms of the GNU General Public License as published by  *
# Line 120  namespace LinuxSampler { Line 120  namespace LinuxSampler {
120                  return y;                  return y;
121              }              }
122    
123              inline bq_t Apply(biquad_param_t* param, const bq_t x) {              inline bq_t Apply(const biquad_param_t* __restrict param, const bq_t x) {
124                  bq_t y;                  bq_t y;
125    
126                  y = param->b0 * x + param->b1 * this->x1 + param->b2 * this->x2 +                  y = param->b0 * x + param->b1 * this->x1 + param->b2 * this->x2 +
# Line 238  namespace LinuxSampler { Line 238  namespace LinuxSampler {
238                  return y;                  return y;
239              }              }
240    
241              inline bq_t ApplyFB(biquad_param_t* param, bq_t x, const bq_t fb) {              inline bq_t ApplyFB(const biquad_param_t* __restrict param, bq_t x, const bq_t fb) {
242                  bq_t y;                  bq_t y;
243    
244                  x += this->y1 * fb * 0.98;                  x += this->y1 * fb * 0.98;
# Line 474  namespace LinuxSampler { Line 474  namespace LinuxSampler {
474                  this->a2 = a0r * (alpha - 1.0);                  this->a2 = a0r * (alpha - 1.0);
475              }              }
476    
477              inline void SetParameters(biquad_param_t* param, bq_t fc, bq_t bw, bq_t fs) {              inline void SetParameters(biquad_param_t* __restrict param, bq_t fc, bq_t bw, bq_t fs) {
478                  bq_t omega = 2.0 * M_PI * fc / fs;                  bq_t omega = 2.0 * M_PI * fc / fs;
479                  bq_t sn    = sin(omega);                  bq_t sn    = sin(omega);
480                  bq_t cs    = cos(omega);                  bq_t cs    = cos(omega);
# Line 511  namespace LinuxSampler { Line 511  namespace LinuxSampler {
511                  this->a2 = a0r * (alpha - 1.0);                  this->a2 = a0r * (alpha - 1.0);
512              }              }
513    
514              inline void SetParameters(biquad_param_t* param, bq_t fc, bq_t bw, bq_t fs) {              inline void SetParameters(biquad_param_t* __restrict param, bq_t fc, bq_t bw, bq_t fs) {
515                  bq_t omega = 2.0 * M_PI * fc / fs;                  bq_t omega = 2.0 * M_PI * fc / fs;
516                  bq_t sn    = sin(omega);                  bq_t sn    = sin(omega);
517                  bq_t cs    = cos(omega);                  bq_t cs    = cos(omega);
# Line 548  namespace LinuxSampler { Line 548  namespace LinuxSampler {
548                  this->a2 = a0r * (alpha - 1.0);                  this->a2 = a0r * (alpha - 1.0);
549              }              }
550    
551              inline void SetParameters(biquad_param_t* param, bq_t fc, bq_t bw, bq_t fs) {              inline void SetParameters(biquad_param_t* __restrict param, bq_t fc, bq_t bw, bq_t fs) {
552                  bq_t omega = 2.0 * M_PI * fc / fs;                  bq_t omega = 2.0 * M_PI * fc / fs;
553                  bq_t sn    = sin(omega);                  bq_t sn    = sin(omega);
554                  bq_t cs    = cos(omega);                  bq_t cs    = cos(omega);

Legend:
Removed from v.2376  
changed lines
  Added in v.2377

  ViewVC Help
Powered by ViewVC