How to plot the magnitude and phase of this Fourier Transform frequency response that contains jw?
    10 Ansichten (letzte 30 Tage)
  
       Ältere Kommentare anzeigen
    
    Harrison Ahn
 am 2 Apr. 2018
  
    
    
    
    
    Beantwortet: Star Strider
      
      
 am 2 Apr. 2018
            I have a frequency response X1 = ((j.*w+100).*(j.*w+200))./((j.*w+10).*(j.*w+1000).*(j.*w+10000)); and would like to plot its magnitude in dB and phase versus the log of frequency with frequency from 0.5Hz to 3000Hz in steps of 5Hz but it doesn't seem to work because of the 'j' in my function.
This is my code:
clf % Clear any existing figure
w = log(0.5):log(5):log(3000); % Frequency from 0.5Hz to 3000Hz with increment of 5Hz
X1 = ((j.*w+100).*(j.*w+200))./((j.*w+10).*(j.*w+1000).*(j.*w+10000)); % Blue
subplot(2,1,1)
plot(w,abs(X1));
title('Magnitude')
ylabel('Magnitude (db)')
xlabel('Log of Frequency')
ylim([-1 10]);
grid on
subplot(2,1,2)
plot(w,angle(X1));
title('Phase')
ylabel('Phase (°)')
xlabel('Log of Frequency')
grid on
0 Kommentare
Akzeptierte Antwort
  Star Strider
      
      
 am 2 Apr. 2018
        If you define ‘w’ differently, and change (or delete) the ‘ylim’ assignment, you can see it.
I defer to you to determine if it does what you want.
w = logspace(-3,4);
X1 = ((j.*w+100).*(j.*w+200))./((j.*w+10).*(j.*w+1000).*(j.*w+10000)); % Blue
subplot(2,1,1)
semilogx(w,20*log10(abs(X1)));
title('Magnitude')
ylabel('Magnitude (dB)')
xlabel('Log of Frequency')
set(gca, 'XLim',[0.5 3000])
% ylim([-1 10]);
grid on
subplot(2,1,2)
semilogx(w,angle(X1)*180/pi);
title('Phase')
ylabel('Phase (°)')
xlabel('Log of Frequency')
set(gca, 'XLim',[0.5 3000])
grid on
I added the conversion to dB in the magnitude plot, and the conversion from radians to degrees in the phase plot, since you apparently want those.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
				Mehr zu Digital Filter Analysis finden Sie in Help Center und File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

