main.m649 chars24 lines
This code defines a time vector and creates a signal y that is the sin(t^2). The sample rate is 4000 Hz. The code specifies filter parameters such as lower and upper cut-off frequencies, sampling frequency, and filter order, and creates a 4th order Butterworth bandpass filter. The code then applies the filter to the original signal y using filtfilt function and creates a filtered signal y_filt. Finally, the code plots the original signal y and filtered signal y_filt. The original signal is shown in blue and the filtered signal is shown in red. The plot function is used to plot the signals. The xlabel, ylabel, and legend functions are used to label the plot.
gistlibby LogSnag