Calculate and plot linear amplitude versus linear frequency.
Afficher commentaires plus anciens
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 commentaire
Mathieu NOE
le 16 Fév 2023
you did not provide the mat file
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Spectral Measurements dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!