how can I plot frequency spectrum and impulse response with hold on?
Show older comments
Hi. I passed the signals in the time domain to the frequency domain and plotted the spectrum:
L = length(Ti{i,j}); % Length Of Time & Signal Vectors
Ts = mean(diff(Tt)); % Sampling Interval
Fs{i,j} = 1/Ts; % Sampling Frequency
Fn = Fs{i,j}/2; % Nyquist Frequency
X = fftshift(fft(x)/L);
Fv2 = linspace(-Fn, Fn, L);
plot(Fv2, abs(X));
grid;
xlabel('Frequency (Hz)');
ylabel('Amplitude');

Then I designed a low pass filter and plotted the impulse response of the filter:
[n, fo, ao, w] = firpmord ([0.09 0.7], [1 0], [0.001 0.01], Fs{i,j});
b = firpm (n, fo, ao, w);
filtered_signal{i,j} = filtfilt(b,1,nonoffset{i,j});
fvtool(b,1)

I want to plot the graph of the signal in the frequency domain and the graph of the impulse response. But I need to convert frequency to normalized frequency and convert amplitude to dB. How can I do these? I would be very happy if you show me a way.
Accepted Answer
More Answers (0)
Categories
Find more on Digital Filter Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

