В этом примере показано, как генерировать код HDL для банка из 24 стеллажных фильтров первого порядка, которые реализуют управление звуковым тоном с шагом 1 дБ от -6 дБ до + 6 дБ для басов и троек.
Фильтры аналитически проектируются с использованием простой формулы для фильтра первого порядка с одним полюсом и одним нулем на действительной оси.
Набор фильтров разработан, так как изменение коэффициентов фильтра на лету может привести к переходным процессам в звуке (щелкам и всплывающим окнам) при перемещении управления повышением/вырезанием. Когда набор фильтров работает непрерывно, соответствующий фильтр выбирается из набора фильтров, когда выходной сигнал находится вблизи любого пересечения нуля, чтобы избежать этих переходных процессов.
Используйте частоту дискретизации CD 44,1 кГц с углами bass и treble на частоте 100 Гц и 1600Hz.
Fs = 44100; % all in Hz
Fcb = 100;
Fct = 1600;Отображение угловых частот по касательной для перемещения из аналоговой области в цифровую. Затем определите диапазон применяемого резания и наддува, выбрав общий диапазон 12 дБ за 1 дБ шагов. Преобразуйте децибелы в линейный коэффициент усиления и разделяйте векторы увеличения и сокращения.
basstan = tan(pi*Fcb/Fs); trebletan = tan(pi*Fct/Fs); dbrange = [-6:-1, +1:+6]; % -6 dB to +6 dB linrange = 10.^(dbrange/20); boost = linrange(linrange>1); cut = linrange(linrange<=1); Nfilters = 2 * length(dbrange); % 2X for bass and treble
Выполните билинейное преобразование полюсов, затем вычислите нули фильтров на основе требуемого увеличения или сокращения. Так как boost и cut являются векторами, мы можем проектировать все фильтры одновременно с помощью векторной арифметики. Обратите внимание, что в этих фильтрах всегда один а1.
a2_bass_boost = (basstan - 1) / (basstan + 1); b1_bass_boost = 1 + ((1 + a2_bass_boost) .* (boost - 1)) / 2; b2_bass_boost = a2_bass_boost + ... ((1 + a2_bass_boost) .* (boost - 1)) / 2; a2_bass_cut = (basstan - cut) / (basstan + cut); b1_bass_cut = 1 + ((1 + a2_bass_cut) .* (cut - 1)) / 2; b2_bass_cut = a2_bass_cut + ((1 + a2_bass_cut) .* (cut - 1)) / 2; a2_treble_boost = (trebletan - 1) / (trebletan + 1); b1_treble_boost = 1 + ((1 - a2_treble_boost) .* (boost - 1)) / 2; b2_treble_boost = a2_treble_boost + ... ((a2_treble_boost - 1) .* (boost - 1)) / 2; a2_treble_cut = (cut .* trebletan - 1) / (cut .* trebletan + 1); b1_treble_cut = 1 + ((1 - a2_treble_cut) .* (cut - 1)) / 2; b2_treble_cut = a2_treble_cut + ... ((a2_treble_cut - 1) .* (cut - 1)) / 2;
Создайте массивы числителей и знаменателей для всего банка фильтров. Затем создайте массив ячеек фильтров в форме {b, a, b, a,...} для fvtool. Предварительно распределите массив ячеек на скорость.
filterbank = cell(1, 2*Nfilters); % 2X for numerator and denominator % Duplicate a2's into vectors a2_bass_boost = repmat(a2_bass_boost, 1, length(boost)); a2_bass_cut = repmat(a2_bass_cut, 1, length(cut)); a2_treble_boost = repmat(a2_treble_boost, 1, length(boost)); a2_treble_cut = repmat(a2_treble_cut, 1, length(cut)); filterbank_num = [b1_bass_cut, b1_bass_boost, b1_treble_cut, b1_treble_boost ; ... b2_bass_cut, b2_bass_boost, b2_treble_cut, b2_treble_boost ]'; % a1 is always one filterbank_den = [ones(1, Nfilters); ... a2_bass_cut, a2_bass_boost, a2_treble_cut, a2_treble_boost]'; filterbank(1:2:end) = num2cell(filterbank_num, 2); filterbank(2:2:end) = num2cell(filterbank_den, 2);
Используйте fvtool в режиме логарифмической частоты для более четкого просмотра диапазона звука. Также установите частоту дискретизации.
fvtool(filterbank{:}, 'FrequencyScale', 'log', 'Fs', Fs);
Создайте квантованный фильтр для каждого фильтра двойной точности, созданного выше. Предположим, что входной сигнал CD-качества равен 16 битам, а длина выходного слова равна 18 битам, чтобы обеспечить усиление + 6 дБ с некоторым запасом.
quantizedfilterbank = cell(1, Nfilters); for n = 1:Nfilters quantizedfilterbank{n} = dsp.BiquadFilter('Structure','Direct Form I'); quantizedfilterbank{n}.SOSMatrix = [filterbank_num(n,:),0,... filterbank_den(n,:),0]; quantizedfilterbank{n}.NumeratorCoefficientsDataType = 'Custom'; quantizedfilterbank{n}.CustomNumeratorCoefficientsDataType = numerictype([],16); quantizedfilterbank{n}.CustomDenominatorCoefficientsDataType = numerictype([],16); quantizedfilterbank{n}.CustomScaleValuesDataType = numerictype([],16); quantizedfilterbank{n}.OutputDataType = 'Custom'; quantizedfilterbank{n}.CustomOutputDataType = numerictype([],18,15); quantizedfilterbank{n}.SectionOutputDataType = 'Custom'; quantizedfilterbank{n}.CustomSectionOutputDataType = numerictype([],18,15); quantizedfilterbank{n}.NumeratorProductDataType = 'Full precision'; quantizedfilterbank{n}.DenominatorProductDataType = 'Full precision'; quantizedfilterbank{n}.NumeratorAccumulatorDataType = 'Custom'; quantizedfilterbank{n}.CustomNumeratorAccumulatorDataType = numerictype([],34,30); quantizedfilterbank{n}.DenominatorAccumulatorDataType = 'Custom'; quantizedfilterbank{n}.CustomDenominatorAccumulatorDataType = numerictype([],34,29); quantizedfilterbank{n}.RoundingMethod = 'Floor'; quantizedfilterbank{n}.OverflowAction = 'Wrap'; end
Снова проверьте банк квантованных фильтров с помощью fvtool в режиме логарифмической частоты с помощью набора частот дискретизации.
fvtool(quantizedfilterbank{:}, 'FrequencyScale', 'log', 'Fs', Fs,'Arithmetic','fixed');
Создайте ЛПВП для каждого из 24 фильтров первого порядка и испытательных стендов для проверки каждого проекта. Целевой язык здесь - Verilog.
Используйте методы канонических знаков (CSD), чтобы избежать использования множителей в проекте. Укажите это значение с помощью пары «CoeffMultipliers», «CSD». Поскольку результаты использования этой оптимизации не всегда численно идентичны регулярному умножению, которое приводит к переполнению, установите для свойства ErrorMargin тестового стенда значение 1 бит допустимой ошибки.
Создайте пользовательский стимул для иллюстрации усиления фильтров путем генерации половины цикла 20 Гц тона и 250 циклов 10 кГц тона. Используйте низкочастотный тон для фильтров bass boost/cut и высокочастотный тон для фильтров treble boost/cut.
Создайте временную рабочую папку.
Чтобы создать код VHDL, измените свойство TargetLanguage с Verilog на VHDL.
bassuserstim = sin(2*pi*20/Fs*(0:Fs/40)); trebuserstim = sin(2*pi*10000/Fs*(0:Fs/40)); workingdir = tempname; for n = 1:Nfilters/2 generatehdl(quantizedfilterbank{n},... 'Name', ['tonecontrol', num2str(n)],... 'TargetDirectory', workingdir,... 'InputDataType', numerictype(1,16,15),... 'TargetLanguage', 'Verilog',... 'CoeffMultipliers','CSD', ... 'GenerateHDLTestbench','on', ... 'TestBenchUserStimulus', bassuserstim, ... 'ErrorMargin', 1); end
### Starting Verilog code generation process for filter: tonecontrol1 ### Generating: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol1.v ### Starting generation of tonecontrol1 Verilog module ### Starting generation of tonecontrol1 Verilog module body ### First-order section, # 1 ### Successful completion of Verilog code generation process for filter: tonecontrol1 ### HDL latency is 2 samples ### Starting generation of VERILOG Test Bench. ### Generating input stimulus ### Done generating input stimulus; length 1103 samples. ### Generating Test bench: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol1_tb.v ### Creating stimulus vectors ... ### Done generating VERILOG Test Bench. ### Starting Verilog code generation process for filter: tonecontrol2 ### Generating: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol2.v ### Starting generation of tonecontrol2 Verilog module ### Starting generation of tonecontrol2 Verilog module body ### First-order section, # 1 ### Successful completion of Verilog code generation process for filter: tonecontrol2 ### HDL latency is 2 samples ### Starting generation of VERILOG Test Bench. ### Generating input stimulus ### Done generating input stimulus; length 1103 samples. ### Generating Test bench: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol2_tb.v ### Creating stimulus vectors ... ### Done generating VERILOG Test Bench. ### Starting Verilog code generation process for filter: tonecontrol3 ### Generating: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol3.v ### Starting generation of tonecontrol3 Verilog module ### Starting generation of tonecontrol3 Verilog module body ### First-order section, # 1 ### Successful completion of Verilog code generation process for filter: tonecontrol3 ### HDL latency is 2 samples ### Starting generation of VERILOG Test Bench. ### Generating input stimulus ### Done generating input stimulus; length 1103 samples. ### Generating Test bench: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol3_tb.v ### Creating stimulus vectors ... ### Done generating VERILOG Test Bench. ### Starting Verilog code generation process for filter: tonecontrol4 ### Generating: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol4.v ### Starting generation of tonecontrol4 Verilog module ### Starting generation of tonecontrol4 Verilog module body ### First-order section, # 1 ### Successful completion of Verilog code generation process for filter: tonecontrol4 ### HDL latency is 2 samples ### Starting generation of VERILOG Test Bench. ### Generating input stimulus ### Done generating input stimulus; length 1103 samples. ### Generating Test bench: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol4_tb.v ### Creating stimulus vectors ... ### Done generating VERILOG Test Bench. ### Starting Verilog code generation process for filter: tonecontrol5 ### Generating: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol5.v ### Starting generation of tonecontrol5 Verilog module ### Starting generation of tonecontrol5 Verilog module body ### First-order section, # 1 ### Successful completion of Verilog code generation process for filter: tonecontrol5 ### HDL latency is 2 samples ### Starting generation of VERILOG Test Bench. ### Generating input stimulus ### Done generating input stimulus; length 1103 samples. ### Generating Test bench: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol5_tb.v ### Creating stimulus vectors ... ### Done generating VERILOG Test Bench. ### Starting Verilog code generation process for filter: tonecontrol6 ### Generating: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol6.v ### Starting generation of tonecontrol6 Verilog module ### Starting generation of tonecontrol6 Verilog module body ### First-order section, # 1 ### Successful completion of Verilog code generation process for filter: tonecontrol6 ### HDL latency is 2 samples ### Starting generation of VERILOG Test Bench. ### Generating input stimulus ### Done generating input stimulus; length 1103 samples. ### Generating Test bench: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol6_tb.v ### Creating stimulus vectors ... ### Done generating VERILOG Test Bench. ### Starting Verilog code generation process for filter: tonecontrol7 ### Generating: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol7.v ### Starting generation of tonecontrol7 Verilog module ### Starting generation of tonecontrol7 Verilog module body ### First-order section, # 1 ### Successful completion of Verilog code generation process for filter: tonecontrol7 ### HDL latency is 2 samples ### Starting generation of VERILOG Test Bench. ### Generating input stimulus ### Done generating input stimulus; length 1103 samples. ### Generating Test bench: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol7_tb.v ### Creating stimulus vectors ... ### Done generating VERILOG Test Bench. ### Starting Verilog code generation process for filter: tonecontrol8 ### Generating: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol8.v ### Starting generation of tonecontrol8 Verilog module ### Starting generation of tonecontrol8 Verilog module body ### First-order section, # 1 ### Successful completion of Verilog code generation process for filter: tonecontrol8 ### HDL latency is 2 samples ### Starting generation of VERILOG Test Bench. ### Generating input stimulus ### Done generating input stimulus; length 1103 samples. ### Generating Test bench: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol8_tb.v ### Creating stimulus vectors ... ### Done generating VERILOG Test Bench. ### Starting Verilog code generation process for filter: tonecontrol9 ### Generating: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol9.v ### Starting generation of tonecontrol9 Verilog module ### Starting generation of tonecontrol9 Verilog module body ### First-order section, # 1 ### Successful completion of Verilog code generation process for filter: tonecontrol9 ### HDL latency is 2 samples ### Starting generation of VERILOG Test Bench. ### Generating input stimulus ### Done generating input stimulus; length 1103 samples. ### Generating Test bench: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol9_tb.v ### Creating stimulus vectors ... ### Done generating VERILOG Test Bench. ### Starting Verilog code generation process for filter: tonecontrol10 ### Generating: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol10.v ### Starting generation of tonecontrol10 Verilog module ### Starting generation of tonecontrol10 Verilog module body ### First-order section, # 1 ### Successful completion of Verilog code generation process for filter: tonecontrol10 ### HDL latency is 2 samples ### Starting generation of VERILOG Test Bench. ### Generating input stimulus ### Done generating input stimulus; length 1103 samples. ### Generating Test bench: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol10_tb.v ### Creating stimulus vectors ... ### Done generating VERILOG Test Bench. ### Starting Verilog code generation process for filter: tonecontrol11 ### Generating: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol11.v ### Starting generation of tonecontrol11 Verilog module ### Starting generation of tonecontrol11 Verilog module body ### First-order section, # 1 ### Successful completion of Verilog code generation process for filter: tonecontrol11 ### HDL latency is 2 samples ### Starting generation of VERILOG Test Bench. ### Generating input stimulus ### Done generating input stimulus; length 1103 samples. ### Generating Test bench: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol11_tb.v ### Creating stimulus vectors ... ### Done generating VERILOG Test Bench. ### Starting Verilog code generation process for filter: tonecontrol12 ### Generating: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol12.v ### Starting generation of tonecontrol12 Verilog module ### Starting generation of tonecontrol12 Verilog module body ### First-order section, # 1 ### Successful completion of Verilog code generation process for filter: tonecontrol12 ### HDL latency is 2 samples ### Starting generation of VERILOG Test Bench. ### Generating input stimulus ### Done generating input stimulus; length 1103 samples. ### Generating Test bench: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol12_tb.v ### Creating stimulus vectors ... ### Done generating VERILOG Test Bench.
for n = Nfilters/2+1:Nfilters generatehdl(quantizedfilterbank{n},... 'Name', ['tonecontrol', num2str(n)],... 'TargetDirectory', workingdir,... 'InputDataType', numerictype(1,16,15),... 'TargetLanguage', 'Verilog',... 'CoeffMultipliers','CSD', ... 'GenerateHDLTestbench','on', ... 'TestBenchUserStimulus', bassuserstim, ... 'ErrorMargin', 1); end
### Starting Verilog code generation process for filter: tonecontrol13 ### Generating: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol13.v ### Starting generation of tonecontrol13 Verilog module ### Starting generation of tonecontrol13 Verilog module body ### First-order section, # 1 ### Successful completion of Verilog code generation process for filter: tonecontrol13 ### HDL latency is 2 samples ### Starting generation of VERILOG Test Bench. ### Generating input stimulus ### Done generating input stimulus; length 1103 samples. ### Generating Test bench: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol13_tb.v ### Creating stimulus vectors ... ### Done generating VERILOG Test Bench. ### Starting Verilog code generation process for filter: tonecontrol14 ### Generating: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol14.v ### Starting generation of tonecontrol14 Verilog module ### Starting generation of tonecontrol14 Verilog module body ### First-order section, # 1 ### Successful completion of Verilog code generation process for filter: tonecontrol14 ### HDL latency is 2 samples ### Starting generation of VERILOG Test Bench. ### Generating input stimulus ### Done generating input stimulus; length 1103 samples. ### Generating Test bench: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol14_tb.v ### Creating stimulus vectors ... ### Done generating VERILOG Test Bench. ### Starting Verilog code generation process for filter: tonecontrol15 ### Generating: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol15.v ### Starting generation of tonecontrol15 Verilog module ### Starting generation of tonecontrol15 Verilog module body ### First-order section, # 1 ### Successful completion of Verilog code generation process for filter: tonecontrol15 ### HDL latency is 2 samples ### Starting generation of VERILOG Test Bench. ### Generating input stimulus ### Done generating input stimulus; length 1103 samples. ### Generating Test bench: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol15_tb.v ### Creating stimulus vectors ... ### Done generating VERILOG Test Bench. ### Starting Verilog code generation process for filter: tonecontrol16 ### Generating: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol16.v ### Starting generation of tonecontrol16 Verilog module ### Starting generation of tonecontrol16 Verilog module body ### First-order section, # 1 ### Successful completion of Verilog code generation process for filter: tonecontrol16 ### HDL latency is 2 samples ### Starting generation of VERILOG Test Bench. ### Generating input stimulus ### Done generating input stimulus; length 1103 samples. ### Generating Test bench: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol16_tb.v ### Creating stimulus vectors ... ### Done generating VERILOG Test Bench. ### Starting Verilog code generation process for filter: tonecontrol17 ### Generating: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol17.v ### Starting generation of tonecontrol17 Verilog module ### Starting generation of tonecontrol17 Verilog module body ### First-order section, # 1 ### Successful completion of Verilog code generation process for filter: tonecontrol17 ### HDL latency is 2 samples ### Starting generation of VERILOG Test Bench. ### Generating input stimulus ### Done generating input stimulus; length 1103 samples. ### Generating Test bench: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol17_tb.v ### Creating stimulus vectors ... ### Done generating VERILOG Test Bench. ### Starting Verilog code generation process for filter: tonecontrol18 ### Generating: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol18.v ### Starting generation of tonecontrol18 Verilog module ### Starting generation of tonecontrol18 Verilog module body ### First-order section, # 1 ### Successful completion of Verilog code generation process for filter: tonecontrol18 ### HDL latency is 2 samples ### Starting generation of VERILOG Test Bench. ### Generating input stimulus ### Done generating input stimulus; length 1103 samples. ### Generating Test bench: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol18_tb.v ### Creating stimulus vectors ... ### Done generating VERILOG Test Bench. ### Starting Verilog code generation process for filter: tonecontrol19 ### Generating: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol19.v ### Starting generation of tonecontrol19 Verilog module ### Starting generation of tonecontrol19 Verilog module body ### First-order section, # 1 ### Successful completion of Verilog code generation process for filter: tonecontrol19 ### HDL latency is 2 samples ### Starting generation of VERILOG Test Bench. ### Generating input stimulus ### Done generating input stimulus; length 1103 samples. ### Generating Test bench: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol19_tb.v ### Creating stimulus vectors ... ### Done generating VERILOG Test Bench. ### Starting Verilog code generation process for filter: tonecontrol20 ### Generating: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol20.v ### Starting generation of tonecontrol20 Verilog module ### Starting generation of tonecontrol20 Verilog module body ### First-order section, # 1 ### Successful completion of Verilog code generation process for filter: tonecontrol20 ### HDL latency is 2 samples ### Starting generation of VERILOG Test Bench. ### Generating input stimulus ### Done generating input stimulus; length 1103 samples. ### Generating Test bench: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol20_tb.v ### Creating stimulus vectors ... ### Done generating VERILOG Test Bench. ### Starting Verilog code generation process for filter: tonecontrol21 ### Generating: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol21.v ### Starting generation of tonecontrol21 Verilog module ### Starting generation of tonecontrol21 Verilog module body ### First-order section, # 1 ### Successful completion of Verilog code generation process for filter: tonecontrol21 ### HDL latency is 2 samples ### Starting generation of VERILOG Test Bench. ### Generating input stimulus ### Done generating input stimulus; length 1103 samples. ### Generating Test bench: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol21_tb.v ### Creating stimulus vectors ... ### Done generating VERILOG Test Bench. ### Starting Verilog code generation process for filter: tonecontrol22 ### Generating: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol22.v ### Starting generation of tonecontrol22 Verilog module ### Starting generation of tonecontrol22 Verilog module body ### First-order section, # 1 ### Successful completion of Verilog code generation process for filter: tonecontrol22 ### HDL latency is 2 samples ### Starting generation of VERILOG Test Bench. ### Generating input stimulus ### Done generating input stimulus; length 1103 samples. ### Generating Test bench: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol22_tb.v ### Creating stimulus vectors ... ### Done generating VERILOG Test Bench. ### Starting Verilog code generation process for filter: tonecontrol23 ### Generating: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol23.v ### Starting generation of tonecontrol23 Verilog module ### Starting generation of tonecontrol23 Verilog module body ### First-order section, # 1 ### Successful completion of Verilog code generation process for filter: tonecontrol23 ### HDL latency is 2 samples ### Starting generation of VERILOG Test Bench. ### Generating input stimulus ### Done generating input stimulus; length 1103 samples. ### Generating Test bench: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol23_tb.v ### Creating stimulus vectors ... ### Done generating VERILOG Test Bench. ### Starting Verilog code generation process for filter: tonecontrol24 ### Generating: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol24.v ### Starting generation of tonecontrol24 Verilog module ### Starting generation of tonecontrol24 Verilog module body ### First-order section, # 1 ### Successful completion of Verilog code generation process for filter: tonecontrol24 ### HDL latency is 2 samples ### Starting generation of VERILOG Test Bench. ### Generating input stimulus ### Done generating input stimulus; length 1103 samples. ### Generating Test bench: /tmp/BR2021ad_1655202_180016/mlx_to_docbook2/tpe4874c4f_f00a_4347_bdcc_6629ef456c35/tonecontrol24_tb.v ### Creating stimulus vectors ... ### Done generating VERILOG Test Bench.
На следующем экране показан имитатор ModelSim ® HDL, работающий с этими тестовыми стендами.
Реакция Bass на тональный сигнал 20 Гц:

Трехкратный отклик на тональный сигнал 10 кГц:

Вы разработали набор фильтров из билинейного преобразования с двойной точностью и трехкратных фильтров первого порядка. Затем вы использовали коэффициенты фильтра для создания набора квантованных фильтров с 16-разрядными входами CD-качества и 18-разрядными выходами. Проверив отклик квантованных фильтров, вы создали код Verilog для каждого фильтра в банке фильтров вместе с тестом Verilog, который использовал пользовательский входной стимул для фильтров bass и treble.
Для завершения решения по обеспечению управления тонами в аудиосистеме можно добавить кросс-замирание к выходам каждой секции банка фильтров. Для плавного переключения с одного шага наддува или резания на следующий эти перекрестные переходы должны пройти несколько раз.
Использование полного набора фильтров - это только один подход к решению этого типа задач. Другой подход заключается в использовании двух фильтров для каждого диапазона (басов и троек) с программируемыми коэффициентами, которые могут быть изменены под управлением программного обеспечения. Один из двух фильтров будет текущим, а другой - следующим. При корректировке элементов управления тональным сигналом программа будет выполнять ping-pong между фильтрами, обменивающимися током, и следующими с простым замиранием. Компромисс заключается в том, что набор фильтров с постоянным коэффициентом, показанный выше, не использует множителей, в то время как, казалось бы, более простая схема ping-pong требует нескольких множителей.