Update documentation.

This commit is contained in:
David Reid
2020-02-19 20:32:15 +10:00
parent 50f97346c5
commit ea17a0d820
+7 -4
View File
@@ -986,9 +986,9 @@ and will result in an error.
Low-Pass Filtering Low-Pass, High-Pass and Band-Pass Filtering
================== ===========================================
Low-pass filtering is achieved with the `ma_lpf` API. Example: Low-pass, high-pass and band-pass filtering is achieved with the `ma_lpf`, `ma_hpf` and `ma_bpf` APIs respective. Low-pass filter example:
```c ```c
ma_lpf_config config = ma_lpf_config_init(ma_format_f32, channels, sampleRate, cutoffFrequency); ma_lpf_config config = ma_lpf_config_init(ma_format_f32, channels, sampleRate, cutoffFrequency);
@@ -1011,7 +1011,7 @@ Filtering can be applied in-place by passing in the same pointer for both the in
ma_lpf_process_pcm_frames(&lpf, pMyData, pMyData, frameCount); ma_lpf_process_pcm_frames(&lpf, pMyData, pMyData, frameCount);
``` ```
The low-pass filter is implemented as a biquad filter. If you need to increase the filter order, simply chain multiple low-pass filters together. These filters are implemented as a biquad filter. If you need to increase the filter order, simply chain multiple filters together.
```c ```c
for (iFilter = 0; iFilter < filterCount; iFilter += 1) { for (iFilter = 0; iFilter < filterCount; iFilter += 1) {
@@ -1023,6 +1023,9 @@ If you need to change the configuration of the filter, but need to maintain the
useful if you need to change the sample rate and/or cutoff frequency dynamically while maintaing smooth transitions. Note that changing the format or channel useful if you need to change the sample rate and/or cutoff frequency dynamically while maintaing smooth transitions. Note that changing the format or channel
count after initialization is invalid and will result in an error. count after initialization is invalid and will result in an error.
The example code above is for low-pass filters, but the same applies for high-pass and band-pass filters, only you should use the `ma_hpf` and `ma_bpf` APIs
instead.
Waveforms Waveforms