Generate quasi-logarithmic frequency set for use with FFT and for the generation of periodic excitation signals.
Syntax
fqlog = lin2qlog(freqv,rf)
[fqlog,df,cdmax,freqind] = lin2qlog(freqv,rf)
fqlog = log2qlog(freqv,mhno)
[fqlog,df,cdmax,freqind] = log2qlog(freqv,mhno)
Description
Both routines calculate a subset of the linear frequency grid, where the members of this subset are more or less logarithmically distributed.
lin2qlog starts from a linear frequency grid, given in freqv, and selects a quasi-logarithmic set, providing that the ratio of successive frequencies is about rf (or larger, if the frequency vector is not dense enough).
log2qlog starts from the given logarithmic frequency set freqv, and rounds these frequencies to values of the linear (DFT) frequency grid. The harmonic number mhno will be associated to the highest frequency. Multiple frequency points are eliminated. log2qlog also works with a non-logarithmic input vector, and produces a close equivalent on the DFT grid.
fqlog is the quasi-logarithmic frequency vector, and df is the size of the frequency step in the corresponding full linear grid. The period length of the corresponding multisine is usually 1/df, but if the harmonic numbers have a common divider, it may be smaller. The largest common divider is given by cdmax, thus the period length is in general 1/(cdmax*df).
The harmonic numbers in fqlog can be calculated as
harmno = round(fqlog/df);
freqind is a column vector, containing indices of the selected frequency points of freqv.
Examples
fqlog = lin2qlog([1:128],sqrt(2));
[fqlog,df] = ...
log2qlog(logspace(log10(1),log10(256),17),256);
Diagnostics
freqv must be real, non-negative and strictly increasing; mhno must be a positive integer.
Algorithm
lin2qlog: starting from the first non-zero frequency point fqlog(1), the next point fqlog(2) will be the one in freqv, closest to fqlog(1)*rf, and larger than fqlog(1). The points of freqv between fqlog(1) and fqlog(2) are deleted. This is repeated until the end of the file: the last point will be taken only if the last frequency is larger than or equal to fqlog(n-1)*rf.
log2qlog: the points of fqlog will be chosen from the points of the grid max(freqv)*[1:mhno]/mhno. A point will be selected if it is closer to a point in freqv than any other point of the linear grid.
See Also
logspace
[ Previous | Help Desk | Next ]