-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added insert() method to dspu::Sample class that allows to insert some zeroed chunks to the sample at the specified position. * Improved sidechain algorithm related to RMS refresh. * Implemented linear-phase FFT crossover. * Updated build scripts. * Updated module versions in dependencies.
- Loading branch information
Showing
28 changed files
with
3,131 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
/* | ||
* Copyright (C) 2023 Linux Studio Plugins Project <https://lsp-plug.in/> | ||
* (C) 2023 Vladimir Sadovnikov <[email protected]> | ||
* | ||
* This file is part of lsp-dsp-units | ||
* Created on: 8 авг. 2023 г. | ||
* | ||
* lsp-dsp-units is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* any later version. | ||
* | ||
* lsp-dsp-units is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with lsp-dsp-units. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#ifndef LSP_PLUG_IN_DSP_UNITS_MISC_FFT_CROSSOVER_H_ | ||
#define LSP_PLUG_IN_DSP_UNITS_MISC_FFT_CROSSOVER_H_ | ||
|
||
#include <lsp-plug.in/dsp-units/version.h> | ||
#include <lsp-plug.in/common/types.h> | ||
|
||
namespace lsp | ||
{ | ||
namespace dspu | ||
{ | ||
namespace crossover | ||
{ | ||
/** | ||
* This header allows to generate characteristics of linear-phase crossover filters. | ||
*/ | ||
|
||
/** | ||
* Compute the magintude of the hi-pass crossover filter | ||
* @param f the array of frequencies | ||
* @param f0 the cut-off frequency of the filter, at which it gives -6 dB attenuation | ||
* @param slope the slope of the filter, attenuation in dB/octave. Negative value. If slope | ||
* is greater than -3 dB, it is considered to be no attenuation after -6 dB fall-off | ||
* @return the actual filter's magnitude at the specified frequency | ||
*/ | ||
LSP_DSP_UNITS_PUBLIC | ||
float hipass(float f, float f0, float slope); | ||
|
||
/** | ||
* Compute the magintude of the lo-pass crossover filter | ||
* @param f the array of frequencies | ||
* @param f0 the cut-off frequency of the filter, at which it gives -6 dB attenuation | ||
* @param slope the slope of the filter, attenuation in dB/octave. Negative value. If slope | ||
* is greater than -3 dB, it is considered to be no attenuation after -6 dB fall-off | ||
* @return the actual filter's magnitude at the specified frequency | ||
*/ | ||
LSP_DSP_UNITS_PUBLIC | ||
float lopass(float f, float f0, float slope); | ||
|
||
/** | ||
* Generate characteristics of the hipass crossover filter | ||
* @param gain the array to store output filter magintude for each frequency at the input | ||
* @param f the array of frequencies | ||
* @param f0 the cut-off frequency of the filter, at which it gives -6 dB attenuation | ||
* @param slope the slope of the filter, attenuation in dB/octave. Negative value. If slope | ||
* is greater than -3 dB, it is considered to be no attenuation after -6 dB fall-off | ||
* @param count the overall number of frequencies in the input array of frequencies | ||
*/ | ||
LSP_DSP_UNITS_PUBLIC | ||
void hipass_set(float *gain, const float *f, float f0, float slope, size_t count); | ||
|
||
/** | ||
* Apply characteristics of the hipass crossover filter, usual when building bandpass filter | ||
* from low-pass and high-pass filters. | ||
* @param gain the array to store output filter magintude for each frequency at the input | ||
* @param f the array of frequencies | ||
* @param f0 the cut-off frequency of the filter, at which it gives -6 dB attenuation | ||
* @param slope the slope of the filter, attenuation in dB/octave. Negative value. If slope | ||
* is greater than -3 dB, it is considered to be no attenuation after -6 dB fall-off | ||
* @param count the overall number of frequencies in the input array of frequencies | ||
*/ | ||
LSP_DSP_UNITS_PUBLIC | ||
void hipass_apply(float *gain, const float *f, float f0, float slope, size_t count); | ||
|
||
/** | ||
* Generate characteristics of the lowpass crossover filter | ||
* @param gain the array to store output filter magintude for each frequency at the input | ||
* @param f the array of frequencies | ||
* @param f0 the cut-off frequency of the filter, at which it gives -6 dB attenuation | ||
* @param slope the slope of the filter, attenuation in dB/octave. Negative value. If slope | ||
* is greater than -3 dB, it is considered to be no attenuation after -6 dB fall-off | ||
* @param count the overall number of frequencies in the input array of frequencies | ||
*/ | ||
LSP_DSP_UNITS_PUBLIC | ||
void lopass_set(float *gain, const float *f, float f0, float slope, size_t count); | ||
|
||
/** | ||
* Apply characteristics of the lowpass crossover filter, usual when building bandpass filter | ||
* from low-pass and high-pass filters. | ||
* @param gain the array to store output filter magintude for each frequency at the input | ||
* @param f the array of frequencies | ||
* @param f0 the cut-off frequency of the filter, at which it gives -6 dB attenuation | ||
* @param slope the slope of the filter, attenuation in dB/octave. Negative value. If slope | ||
* is greater than -3 dB, it is considered to be no attenuation after -6 dB fall-off | ||
* @param count the overall number of frequencies in the input array of frequencies | ||
*/ | ||
LSP_DSP_UNITS_PUBLIC | ||
void lopass_apply(float *gain, const float *f, float f0, float slope, size_t count); | ||
|
||
/** | ||
* Generate magnitude characteristics of the hipass crossover filter for FFT processing. | ||
* @param gain the array to store output filter magintude for each frequency at the input | ||
* @param f0 the cut-off frequency of the filter, at which it gives -6 dB attenuation | ||
* @param slope the slope of the filter, attenuation in dB/octave. Negative value. If slope | ||
* is greater than -3 dB, it is considered to be no attenuation after -6 dB fall-off | ||
* @param count the overall number of frequencies in the input array of frequencies | ||
*/ | ||
LSP_DSP_UNITS_PUBLIC | ||
void hipass_fft_set(float *mag, float f0, float slope, float sample_rate, size_t rank); | ||
|
||
/** | ||
* Apply magnitude characteristics of the hipass crossover filter for FFT processing, usual | ||
* when building bandpass filter from low-pass and high-pass filters. | ||
* @param gain the output filter gain for each frequency at the input, should be of 2^rank length. | ||
* @param f0 the cut-off frequency of the filter, at which it gives -6 dB attenuation | ||
* @param slope the slope of the filter, attenuation in dB/octave. Negative value. If slope | ||
* is greater than -3 dB, it is considered to be no attenuation after -6 dB fall-off | ||
* @param count the overall number of frequencies in the input array of frequencies | ||
*/ | ||
LSP_DSP_UNITS_PUBLIC | ||
void hipass_fft_apply(float *mag, float f0, float slope, float sample_rate, size_t rank); | ||
|
||
/** | ||
* Generate magnitude characteristics of the lowpass crossover filter for FFT processing. | ||
* @param gain the output filter gain for each frequency at the input, should be of 2^rank length. | ||
* @param f0 the cut-off frequency of the filter, at which it gives -6 dB attenuation | ||
* @param slope the slope of the filter, attenuation in dB/octave. Negative value. If slope | ||
* is greater than -3 dB, it is considered to be no attenuation after -6 dB fall-off | ||
* @param count the overall number of frequencies in the input array of frequencies | ||
*/ | ||
LSP_DSP_UNITS_PUBLIC | ||
void lopass_fft_set(float *mag, float f0, float slope, float sample_rate, size_t rank); | ||
|
||
/** | ||
* Apply magnitude characteristics of the lowpass crossover filter for FFT processing, usual | ||
* when building bandpass filter from low-pass and high-pass filters. | ||
* @param gain the output filter gain for each frequency at the input, should be of 2^rank length. | ||
* @param f0 the cut-off frequency of the filter, at which it gives -6 dB attenuation | ||
* @param slope the slope of the filter, attenuation in dB/octave. Negative value. If slope | ||
* is greater than -3 dB, it is considered to be no attenuation after -6 dB fall-off | ||
* @param count the overall number of frequencies in the input array of frequencies | ||
*/ | ||
LSP_DSP_UNITS_PUBLIC | ||
void lopass_fft_apply(float *mag, float f0, float slope, float sample_rate, size_t rank); | ||
|
||
} /* namespace crossover */ | ||
} /* namespace dspu */ | ||
} /* namespace lsp */ | ||
|
||
|
||
|
||
#endif /* LSP_PLUG_IN_DSP_UNITS_MISC_FFT_CROSSOVER_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
* Copyright (C) 2020 Linux Studio Plugins Project <https://lsp-plug.in/> | ||
* (C) 2020 Vladimir Sadovnikov <[email protected]> | ||
* Copyright (C) 2023 Linux Studio Plugins Project <https://lsp-plug.in/> | ||
* (C) 2023 Vladimir Sadovnikov <[email protected]> | ||
* | ||
* This file is part of lsp-dsp-units | ||
* Created on: 03 авг. 2016 г. | ||
|
@@ -62,14 +62,16 @@ namespace lsp | |
namespace dspu | ||
{ | ||
/** | ||
* Crossover callback function for processing band signal | ||
* Crossover callback function for processing band signal. Because the internal processing buffer | ||
* of crossover is limited, the function can be called multiple times. To understand the right offset | ||
* relatively to the original buffer, the 'first' parameter can be used. | ||
* | ||
* @param object the object that handles callback | ||
* @param subject the subject that is used to handle callback | ||
* @param band number of the band | ||
* @param data the output band signal produced by crossover, | ||
* is valid only until the function returns | ||
* @param first index of the first sample in input buffer | ||
* @param first index of the first sample in the data buffer relatively to the original input buffer | ||
* @param count number of processed samples in the data buffer | ||
*/ | ||
typedef void (* crossover_func_t)(void *object, void *subject, size_t band, const float *data, size_t first, size_t count); | ||
|
@@ -353,7 +355,7 @@ namespace lsp | |
*/ | ||
void dump(IStateDumper *v) const; | ||
}; | ||
} | ||
} /* namespace dspu */ | ||
} /* namespace lsp */ | ||
|
||
#endif /* LSP_PLUG_IN_DSP_UNITS_UTIL_CROSSOVER_H_ */ |
Oops, something went wrong.