Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
"Problem" with itting with free-knot B-splines

Subject: "Problem" with itting with free-knot B-splines

From: drgz

Date: 9 Mar, 2010 09:28:08

Message: 1 of 2

Not so familiar with making functions from fitting data, so I hope someone can point out what I'm doing wrong.

http://img502.imageshack.us/img502/8171/ampmscatterfit.png

Figure of the data I'm trying to fit, and the curve that I've managed to find with fitting the data with free-knot B-splines (using the BSFK function from the File Exchange).

As seen in the figure, the fitted curve starts at zero (or something) and then quickly goes up to the level where most of the data is localized. How can I manipulate the spline function to start at more suitable levels such that I avoid this sudden increase in the function? I.e make it start at values around 1.02 for small values on the x-axis.

The code I've used for deriving the spline function is as follows

%%% B-Spline options
nknots = 10;
sigma = 0;
options = struct('KnotRemoval','none','sigma',sigma);

%%% Normalize input and output signals
xEnvNorm = abs(x)/max(abs(x));
yEnvNorm = abs(yPAm)/max(abs(yPAm));

xVec = 0:1/length(x):1-1/length(x);

phase = unwrap(angle(yPAm)-angle(x));
phase = phase/mean(phase);

ampmSpline = BSFK(xEnvNorm,phase,3,nknots,[],options);
ampmSplineFit = ppval(ampmSpline,xVec);

figure
scatter(xEnvNorm,phase,'.r'); hold on;
plot(xVec,ampmSplineFit,'b','linewidth',1.5);
xlabel('Normalized input amplitude');
ylabel('Normalized AM/PM, radians')
axis([0 1 mean(phase)-0.1 mean(phase)+0.1])

Any help is appreciated!

D.

Subject: "Problem" with itting with free-knot B-splines

From: drgz

Date: 9 Mar, 2010 14:00:22

Message: 2 of 2

One obviously learn as long as one lives; trick was to set min input value (x value) to 0dBm (10^(-1.5) in amplitude).

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us