how can I plot frequency spectrum and impulse response with hold on?
Ältere Kommentare anzeigen
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.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Digital Filter Analysis finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


