Log Frequency Scale in Octave

Published

Introduction: Log Frequency Scale in Octave

About: Too much television as a kid.

Say you are defining a filter in GNU Octave. You need the frequency on the horizontal axis to be logarithmic instead of linear. This is done using the semilogx() function. In the next step you can see a high pass filter (HP) that demonstrates just that and generates the above image.

Step 1: Semilogx()

freq = [20:100:20000];
xc = 1 ./ (2 * pi * 0.000000016 * freq); z = sqrt(xc.^2 + 1000^2); vout = 10.0 * 1000 ./ z; semilogx(freq, vout, ‘r-’); grid on; xlabel(‘freq’); ylabel(‘volts’); legend(‘HP filter’);

Share

    Recommendations

    • Casting Contest

      Casting Contest
    • Woodworking Contest

      Woodworking Contest
    • Microcontroller Contest

      Microcontroller Contest
    user

    We have a be nice policy.
    Please be positive and constructive.

    Tips

    Questions

    Comments