Calculate and plot linear amplitude versus linear frequency.
Mostrar comentarios más antiguos
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 comentario
Mathieu NOE
el 16 de Feb. de 2023
you did not provide the mat file
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Spectral Measurements en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!