DSP Eval 2
DSP Eval 2
2
DIGITAL SIGNAL PROCESSING
Report
In the MATLAB filter design functions like fir1(), the cutoff frequency is expressed as a
normalized value with respect to the Nyquist frequency, which is half of the sampling
frequency.
Where:
% Filter Specifications
fc = 1;
fs = 10;
order = 20;
% Convert frequencies to Hz
fc = fc * 1000; % Convert cutoff frequency to Hz
fs = fs * 1000; % Convert sampling frequency to Hz
wc = fc / (fs / 2);
Vivado
module fir_filter #(parameter N = 3) (
input clk, // Clock signal
input reset, // Reset signal
input [15:0] x_in, // 16-bit input signal (fixed-
point)
output [15:0] y_out // 16-bit output signal (fixed-
point)
);
// Clock generation
always begin
#5 clk = ~clk; // Toggle clock every 5 time units
end
// Stimulus process
initial begin
// Initialize signals
clk = 0;
reset = 1;
x_in = 16'h0000; // Initial value of 0
endmodule
updated code with coefficient change
module fir_filter #(parameter N = 21) (
input clk, // Clock signal
input reset, // Reset signal
input [15:0] x_in, // 16-bit input signal (fixed-
point)
output [15:0] y_out // 16-bit output signal (fixed-
point)
);
endmodule
// Clock generation
always begin
#5 clk = ~clk; // Toggle clock every 5 time units
end
// Stimulus process
initial begin
// Initialize signals
clk = 0;
reset = 1;
x_in = 16'h0000; // Initial value of 0
endmodule