% MATLAB Code % Generated by MATLAB(R) 7.14 and the DSP System Toolbox 8.2. % % Generated on: 18-Jul-2016 13:27:14 % FIR Window Lowpass filter designed using the FIR1 function. % All frequency values are in Hz. Fs = 3200000; % Sampling Frequency Fpass = 300000; % Passband Frequency Fstop = 330000; % Stopband Frequency Dpass = 0.057501127785; % Passband Ripple Dstop = 0.031622776602; % Stopband Attenuation flag = 'scale'; % Sampling Flag % Calculate the order from the parameters using KAISERORD. [N,Wn,BETA,TYPE] = kaiserord([Fpass Fstop]/(Fs/2), [1 0], [Dstop Dpass]); % Calculate the coefficients using the FIR1 function. b = fir1(N, Wn, TYPE, kaiser(N+1, BETA), flag); Hd = dfilt.dffir(b); % [EOF] freqz(b,1,492); y = filter(b,1,sig_shift); spectr_y = abs(fftshift(fft(y(end-N:end)))); figure(4); plot((1:N)*Fd/N-Fd/2,20*log10(spectr_y(1:N))); P = unwrap(angle(y)); figure(5); plot(P)