Repository navigation
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
In this example,we design a FIR lowpass filter with matlab, whos pass frequence is 0.15 and stop frequence is 0.2, and generating verilog file for this FIR filter. Hlp.v is the lowpass FIR fliter, and Hlp_tb.v is the testbench for Hlp.v, both of these files are gengerated by matlab.
1. test this filter with the testbench which generated by matlab
iverilog Hlp.v Hlp_tb.v -o Hlp
vvp -n Hlp
2. generate the the testdata for Hlp.v
gcc -o Gen GenerateSinData.c -lm
./Gen > G.txt
3. test this filter with test data
iverilog Hlp.v HlpSintp.v -o Hlptp
vvp -n Hlptp > Sintp.txt
4. convert the Hex testdata to Dec testdata
gcc -o HexToDec HexToDec
./HexToDec < G.txt > G.dec
./HexToDec < Sintp.txt > Sintp.dec
5. fft the testdata
run fftprocessing.m in matlab