help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Plotting the frequency response of a filter in "real" Hz


From: Guilherme Ritter
Subject: Re: Plotting the frequency response of a filter in "real" Hz
Date: Fri, 22 Apr 2016 19:26:55 -0300

@ Sergei Steshenko

2016-04-22 16:16 GMT-03:00 Maynard Wright <address@hidden>:
>> --//--
>>
>> @ Maynard Wright
>>
>> That just makes the x axis be between 0 and 0,5. Not what I'm looking
>> for. I'm looking for Hz in the audio range.
>>
>
> Here's an example with plots which is probably not appropriate to post to the
> full list as I think that the attached figures would be stripped away anyway.
>
> I think, and I could be wrong, that what you have is a function that produces
> a filter response in terms of the radian frequency and you would like to plot
> the same result in terms of the frequency in Hz.   If that's so, the code
> below will do that.   I've included a trivial filter as an example.   The 
> code,
> as is, will plot the amplitude function of the filter as a function of the
> radian frequency.
>
> If you uncomment the commented lines and comment out the lines associated with
> the radian frequency, you will get a plot of the same function in terms of the
> frequency in Hz.
>
> Note that the function is not recalculated.   It is simply plotted against a
> scaled x-axis function.
>
> I use gnuplot because it's easier to work with when you use screen capture but
> you don't have to do that.
>
>
> graphics_toolkit("gnuplot");
> w = linspace(1, 15000, 100);
> fHz = w / (2 * pi);
> loss = abs((12000 ./ (12000 .+ 1j .* w)) .^ 7);
> loglog(w, loss);
> % loglog(fHz, loss);
> axis([1e-1, 1e5, 2e-2, 2]);
> xlabel("radian frequency");
> % axis([1e-1, 1e4, 2e-2, 2]);
> % xlabel("frequency in Hz");
> ylabel("amplitude");
> grid;
> pause;
>
>
> Best regards,
>
>
> Maynard Wright
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]