Calculate and plot linear amplitude versus linear frequency.
Ältere Kommentare anzeigen
The only thing I need from this question is to make a plot of linear amplitude vs linear frequency and how to make my plots so that their ranges are between 10 and 400 Hz.
Here is the question:
The file filter1.mat contains the spectrum of a fourth-order lowpass filter as variable x in dB. The file also contains the corresponding frequencies of x in variable freq. Plot the spectrum of this filter both as dB versus log frequency and as linear amplitude versus linear frequency. The frequency axis should range between 10 and 400 Hz in both plots. Hint: Use Equation 2.23.
(2.23) SNRlinear = 10^(dB/20)
clear all;
close all;
clc;
load filter1.mat;
logf = log(freq); % Calculate natural log of frequency
subplot(2,1,1);
plot(x,freq); % Plot spectrum of 4th order lowpass filter
subplot(2,1,2);
plot(x,logf); % Plot x in dB vs natural log of frequency
subplot(2,2,1);
1 Kommentar
Mathieu NOE
am 16 Feb. 2023
you did not provide the mat file
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Spectral Measurements finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!