18 #ifndef _dsp_filter_h_
19 #define _dsp_filter_h_
37 namespace ARDOUR {
namespace DSP {
62 assert (
sizeof(
float) ==
sizeof (int32_t));
63 assert (
sizeof(
float) ==
sizeof (
int));
76 if (s ==
_size) {
return; }
120 std::atomic_thread_fence (std::memory_order_release);
137 std::atomic_thread_fence (std::memory_order_acquire);
147 void memset (
float *data,
const float val,
const uint32_t n_samples);
155 void mmult (
float *data,
float *mult,
const uint32_t n_samples);
163 void peaks (
const float *data,
float &min,
float &max, uint32_t n_samples);
198 void proc (
float *data,
const uint32_t n_samples);
207 void ctrl (
float *data,
const float val,
const uint32_t n_samples);
252 void run (
float *data,
const uint32_t n_samples);
263 void configure (
double a1,
double a2,
double b0,
double b1,
double b2);
277 void coefficients (
double& a1,
double& a2,
double& b0,
double& b1,
double& b2)
const;
280 void calc_vicanek (
const double W0,
double& A0,
double& A1,
double& A2,
double& phi0,
double& phi1,
double& phi2);
307 void set_data_hann (
float const *
const data,
const uint32_t n_samples,
const uint32_t offset = 0);
320 return bin * _fft_freq_per_bin;
326 void init (uint32_t window_size,
double rate);
385 float*
ipdata ()
const {
return _ipdata; }
388 float pmax ()
const {
return _pmax; }
399 static const int _fftlen = 512;
431 void run (
float *data,
const uint32_t n_samples);
436 float randf () {
return (randi () / 1073741824.f) - 1.f; }
442 float _b0, _b1, _b2, _b3, _b4, _b5, _b6;
void set_vicanek_poles(const double W0, const double Q, const double A=1.0)
void calc_vicanek(const double W0, double &A0, double &A1, double &A2, double &phi0, double &phi1, double &phi2)
Biquad(double samplerate)
void compute(Type t, double freq, double Q, double gain)
void run(float *data, const uint32_t n_samples)
void coefficients(double &a1, double &a2, double &b0, double &b1, double &b2) const
Biquad(const Biquad &other)
void configure(Biquad const &)
void configure(double a1, double a2, double b0, double b1, double b2)
float dB_at_freq(float freq) const
int32_t atomic_get_int(size_t off)
void atomic_set_int(size_t off, int32_t val)
float * to_float(size_t off)
int32_t * to_int(size_t off)
void set_data_hann(float const *const data, const uint32_t n_samples, const uint32_t offset=0)
uint32_t _fft_window_size
FFTSpectrum(uint32_t window_size, double rate)
void init(uint32_t window_size, double rate)
float power_at_bin(const uint32_t bin, const float gain=1.f, bool pink=false) const
float freq_at_bin(const uint32_t bin) const
void run(float *data, const uint32_t n_samples)
void set_cutoff(float freq)
LowPass(double samplerate, float freq)
void ctrl(float *data, const float val, const uint32_t n_samples)
void proc(float *data, const uint32_t n_samples)
float power_at_bin(const uint32_t bin, const float gain=1.f, bool pink=false) const
void process(int iplen, ProcessMode mode=MM_NONE)
void set_wfact(enum Warp)
PerceptualAnalyzer(PerceptualAnalyzer const &)=delete
PerceptualAnalyzer(double rate, int ipsize=4096)
void set_speed(float speed)
static double warp_freq(double w, double f)
void set_speed(enum Speed)
float freq_at_bin(const uint32_t bin) const
void set_wfact(float wfact)
float conv1(fftwf_complex *)
float conv0(fftwf_complex *)
virtual float power_at_bin(const uint32_t bin, const float gain, bool pink) const =0
virtual float freq_at_bin(const uint32_t bin) const =0
virtual ~SpectrumAnalyzer()
int cache_aligned_malloc(void **memptr, size_t size)
void cache_aligned_free(void *memptr)
float log_meter_coeff(float coeff)
void mmult(float *data, float *mult, const uint32_t n_samples)
float log_meter(float power)
void process_map(BufferSet *bufs, const ChanCount &n_out, const ChanMapping &in_map, const ChanMapping &out_map, pframes_t nframes, samplecnt_t offset)
void peaks(const float *data, float &min, float &max, uint32_t n_samples)
void memset(float *data, const float val, const uint32_t n_samples)
PBD::PropertyDescriptor< gain_t > gain
Temporal::samplecnt_t samplecnt_t
DEFINE_ENUM_CONVERT(ARDOUR::DSP::PerceptualAnalyzer::Speed)