R Dsp_fpga » Обсуждения


Bookmark and Share




Преобразование математического описания в схему

апр 15, 2019 | 11:04
Метод поэтапного преобразования алгоритма ЦОС из математического представления в схемное решение на VHDL через моделирование в Матлаб.
 
План
1) Возьмем для примера ДПФ из статьи Серга Келлиса
2) Рассмотрим создание модели и схемы для алгоритма Малла и их реализацию в Xilinx Vivaldo.
3) Сформулируем общие принципы. Например, какие блоки математического аппарата лучше всего представляются в виде шагов алгоритма, а какие — в виде элементов схемы.
ДПФ с основанием 2

 
 
Разложение на четные и нечетные слагаемые

 
 
 
Представление равенства в виде 2х ДПФ меньшего размера
 

 
 
Какие блоки будут присутствовать в схеме
— 4-точечный ДПФ
entity fft_4 is
GENERIC(NUM_BITS: POSITIVE := 10;
PRECISION: POSITIVE := 5);
Port ( clk : in STD_LOGIC;
x_real: in fftsamples(0 to 3); --The input must be a signed fix point number
with #NUM_BITS bits before the dot and #PRECISION bits after it.
x_imag: in fftsamples(0 to 3);
y_real: out fftsamples(0 to 3); --The output will be a signed fix point number
with #NUM_BITS bits before the dot and #PRECISION bits after it.
y_imag: out fftsamples(0 to 3));
end fft_4;
 
— 2-точечный ДПФ
entity fft_2 is
GENERIC(NUM_BITS: POSITIVE := 10;
PRECISION: POSITIVE := 5);
Port ( clk : in STD_LOGIC;
x_real: in fftsamples(0 to 1); --The input must be a signed fix point number
with #NUM_BITS bits before the dot and #PRECISION bits after it.
x_imag: in fftsamples(0 to 1);
y_real: out fftsamples(0 to 1); --The output will be a signed fix point number
with #NUM_BITS bits before the dot and #PRECISION bits after it.
y_imag: out fftsamples(0 to 1));
end fft_2;
 
-умножитель
entity fft_X_sr is
GENERIC(NUM_BITS: POSITIVE := 10;
PRECISION: POSITIVE := 5);
Port ( clk: in STD_LOGIC;
x_real: in fftsamples(0 to X-1);
x_imag: in fftsamples(0 to X-1);
y_real: out fftsamples(0 to X-1);
y_imag: out fftsamples(0 to X-1));
end fft_X_sr;
 
— факторы-коэффициенты
type twiddle_array is array (0 to 1) of sfixed(2 downto -PRECISION);
CONSTANT twiddle_real: twiddle_array := (to_sfixed(0.707106781186548, 2, -
PRECISION),to_sfixed(-0.707106781186548, 2, -PRECISION));
CONSTANT twiddle_imag: twiddle_array := (to_sfixed(-0.707106781186548, 2, -
PRECISION),to_sfixed(-0.707106781186548, 2, -PRECISION));
 
-обобщенный умножитель
entity complex_multiplier is
GENERIC(NUM_BITS: POSITIVE := 10;
PRECISION: POSITIVE := 5);
Port ( clk: in STD_LOGIC;
a_real: in STD_LOGIC_VECTOR(NUM_BITS+PRECISION-1 downto 0);
a_imag: in STD_LOGIC_VECTOR(NUM_BITS+PRECISION-1 downto 0);
b_real: in STD_LOGIC_VECTOR(NUM_BITS+PRECISION-1 downto 0);
b_imag: in STD_LOGIC_VECTOR(NUM_BITS+PRECISION-1 downto 0);
y_real: out STD_LOGIC_VECTOR(NUM_BITS+PRECISION-1 downto 0);
y_imag: out STD_LOGIC_VECTOR(NUM_BITS+PRECISION-1 downto 0));
end complex_multiplier;

Нет комментариев  

Вам необходимо зайти или зарегистрироваться для комментирования