
G(w,n) = 1 / ( sqrt ( 1 + w ** ( 2 * n ))) dB(x) = 20 * log10 ( abs ( x )) # Phase is for first order P(w) = - atan ( w ) * 180 / pi # Gridlines set grid # Set x axis to logarithmic scale set logscale x 10 # No need for a key set no key #0.1,-25 # Frequency response's line plotting style set style line 1 lt 1 lw 2 # Asymptote lines and slope lines are the same "arrow" style set style line 3 lt 3 lw 1 set style arrow 3 nohead ls 3 # -3 dB arrow style set style line 4 lt 4 lw 1 set style arrow 4 head filled size screen 0.02, 15, 45 ls 4 # Separator between passband and stopband line style set style line 2 lt 2 lw 1 set style arrow 2 nohead ls 2 set multiplot # Magnitude response # = set size 1, 0.5 set origin 0, 0.5 # Set range of x and y axes set xrange set yrange # Create x-axis tic marks once per decade (every multiple of 10) set xtics 10 #set ytics 10 # No need for two sets of numbers set format x "" # Use 10 x-axis minor divisions per major division set mxtics 10 # Axis labels set ylabel "Gain (dB)" # Draw asymptote lines set arrow 1 from 1, 0 to 1000, -60 as 3 set arrow 2 from. n is the order, which is just 1 in this image. Set terminal svg enhanced size 1250 875 fname "Times" fsize 25 set output "Butterworth_filter_bode_plot.svg" # Butterworth amplitude response and decibel calculation.
