Quantcast
Channel: MATLAB Central Newsreader Recent Posts
Viewing all articles
Browse latest Browse all 19628

Re: Logarithmic Interpolation

$
0
0
The following works for data such as a spectrum of noise power in dB versus frequency, where we have a linear y-axis and a logarithmic x-axis and a few data points with linear transitions between the points. The trick is to take the log of the frequency vectors when interpolating. Note I repeated the last data point in this case because the data is flat beyond f=10^4.

f = logspace(1,8,1000) ;
data = interp1( log10([1,3,4, max(f)]), [-100, -120, -130, -130], log10(f)) ;
semilogx(f, data) ;


rudzi <eexrd@bristol.ac.uk> wrote in message <23210557.1224856768018.JavaMail.jakarta@nitrogen.mathforum.org>...
> Hi,
>
> How I could apply logarithmic interpolation in my data. I used interp1, but it doesn't have reasonable curves when it comes to semilog curves. As far as I know,interp1 is for linear interpolation. Do I have to come up with my own codes? Pls give a piece of advice.
> Many thanks.

Viewing all articles
Browse latest Browse all 19628

Trending Articles