Inverse constant-Q transform using nonstationary Gabor frames
returns the inverse constant-Q transform,
xrec = icqt(
xrec, of the
cfs is a matrix, cell
array, or structure array.
g is the cell array of nonstationary
Gabor constant-Q analysis filters used to obtain the coefficients
fshifts is a vector of frequency
bin shifts for the constant-Q bandpass filters in
icqt assumes by default that the original signal was
real-valued. To indicate the original input signal was complex-valued, use the
'SignalType' name-value pair. If the input to
was a single signal, then
xrec is a vector. If the input to
cqt was a multichannel signal, then
xrec is a matrix.
fshifts must be outputs of
Perfect Reconstruction of Constant-Q Transform
Load and plot the Handel signal.
load handel t = (0:length(y)-1)/Fs; plot(t,y) title('Handel') xlabel('Time (s)')
Obtain the constant-Q transform of the signal using the
sparse transform option. Because the transform will be inverted, you must also return the Gabor frames and frequency shifts used in the analysis.
[cfs,~,g,fshifts] = cqt(y,'SamplingFrequency',Fs,'TransformType','sparse');
Invert the constant-Q transform and demonstrate perfect reconstruction by showing the maximum absolute reconstruction error and the relative energy error in dB.
xrec = icqt(cfs,g,fshifts); maxAbsError = max(abs(xrec-y))
maxAbsError = 6.9389e-16
relEnergyError = 20*log10(norm(xrec-y)/norm(y))
relEnergyError = -301.4160
cfs — Constant-Q coefficients
matrix | cell array | structure array
Constant-Q coefficients of a signal or multichannel signal, specified as a
matrix, cell array, or structure array.
cfs must be the
g — Nonstationary Gabor constant-Q analysis filters
Nonstationary Gabor constant-Q analysis filters used to obtain the
cfs, specified as a cell array.
cfs must be the output of
fshifts — Frequency bin shifts
Frequency bin shifts for the constant-Q bandpass filters in
g, specified as a real-valued vector.
fshifts must be the output of
sigtype — Signal type
'real' (default) |
Signal type of the original signal, specified as
designate whether the original signal was real-valued or complex-valued. If
sigtype defaults to
xrec — Inverse constant-Q transform
vector | matrix
Inverse constant-Q transform, returned as a vector or matrix. If the input
cqt was a single signal, then
xrec is a
vector. If the input to
cqt was a multichannel signal,
xrec is a matrix.
The theory of nonstationary Gabor (NSG) frames for frequency-adaptive analysis and
efficient algorithms for analysis and synthesis using NSG frames are due to Dörfler,
Holighaus, Grill, and Velasco ,. The algorithms
were developed by Dörfler, Holighaus, Grill, and Velasco and are described in ,. In , Schörkhuber,
Klapuri, Holighaus, and Dörfler develop and provide algorithms for a phase-corrected CQT
transform which matches the CQT coefficients that would be obtained by naïve
convolution. The Large Time-Frequency Analysis Toolbox (https://github.com/ltfat) provides an extensive suite of algorithms
for nonstationary Gabor frames .
 Holighaus, N., M. Dörfler, G. A. Velasco, and T. Grill. "A framework for invertible real-time constant-Q transforms." IEEE Transactions on Audio, Speech, and Language Processing. Vol. 21, No. 4, 2013, pp. 775–785.
 Velasco, G. A., N. Holighaus, M. Dörfler, and T. Grill. "Constructing an invertible constant-Q transform with nonstationary Gabor frames." In Proceedings of the 14th International Conference on Digital Audio Effects (DAFx-11). Paris, France: 2011.
 Schörkhuber, C., A. Klapuri, N. Holighaus, and M. Dörfler. "A Matlab Toolbox for Efficient Perfect Reconstruction Time-Frequency Transforms with Log-Frequency Resolution." Submitted to the AES 53rd International Conference on Semantic Audio. London, UK: 2014.
 Průša, Z., P. L. Søndergaard, N. Holighaus, C. Wiesmeyr, and P. Balazs. The Large Time-Frequency Analysis Toolbox 2.0. Sound, Music, and Motion, Lecture Notes in Computer Science 2014, pp 419-442.
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Usage notes and limitations:
To minimize compilation time, define the nonstationary Gabor constant-Q analysis filters
gas variable size using
coder.typeof(MATLAB Coder). If you define the filters
gas fixed size, compilation time is significant with minimal gain in execution efficiency.