Add methods to compute magnitude and phase response for biquads
[WebKit-https.git] / Source / WebCore / webaudio / BiquadProcessor.h
index e7487262ada10eab548b59a34a5b8102353175f5..c7f7d3068a3cf5de5c824131913bcf6459237986 100644 (file)
@@ -60,6 +60,15 @@ public:
         
     virtual void process(AudioBus* source, AudioBus* destination, size_t framesToProcess);
 
+    // Get the magnitude and phase response of the filter at the given
+    // set of frequencies (in Hz). The phase response is in radians.
+    void getFrequencyResponse(int nFrequencies,
+                              const float* frequencyHz,
+                              float* magResponse,
+                              float* phaseResponse);
+
+    void checkForDirtyCoefficients();
+    
     bool filterCoefficientsDirty() const { return m_filterCoefficientsDirty; }
 
     AudioParam* parameter1() { return m_parameter1.get(); }
@@ -67,7 +76,7 @@ public:
     AudioParam* parameter3() { return m_parameter3.get(); }
 
     FilterType type() const { return m_type; }
-    void setType(FilterType type) { m_type = type; reset(); }
+    void setType(FilterType);
 
 private:
     FilterType m_type;