| 
November 2nd, 2009, 03:46 PM
| | Newbie | | Join Date: Nov 2009
Posts: 2
Country: Thanks: 0
Thanked 0 Times in 0 Posts
| | Some Matlab Help Hi all. I am new here. I though this would be a good place to ask for some help with my Matlab assignment, because i am completely lost.
I need to explore the detection of a signal in the presence of noise, the signal being the first 90 degrees of a sine wave. I need to analyze how good a fit of a polynomial with order and degree as a function increasing noise.
Using an appropriate range of signal to noise ratios, i need to construct the signal for 10 different signal to noise ratios ranging from 10:1 to 0.1:1. I need to generate polynomial fits to the data ranging from order 1 to order 4.
The last part is to calculate the residuals for each combination and demonstrate when a higher order fit is better than a linear fit.
I really need help on this. Any amount will do.
Thanks | 
November 2nd, 2009, 04:31 PM
| | Member | | Join Date: Mar 2007
Posts: 143
Country: Thanks: 20
Thanked 21 Times in 20 Posts
| | Try polyfit and polyeval. Code: EDU>> x = sort(rand(1,5))
x =
0.4456 0.4898 0.6463 0.7094 0.7547
EDU>> y = rand(1,5)
y =
0.2760 0.6797 0.6551 0.1626 0.1190
EDU>> p = polyfit(x,y,4)
p =
1.0e+003 *
1.0569 -2.3779 1.9403 -0.6777 0.0857
EDU>> yp=polyval(p,x)
yp =
0.2760 0.6797 0.6551 0.1626 0.1190
EDU>> plot(x,y,'o',x,yp,'k:')
EDU>>
Elbarto | 
November 2nd, 2009, 04:41 PM
| | Newbie | | Join Date: Nov 2009
Posts: 2
Country: Thanks: 0
Thanked 0 Times in 0 Posts
| | Quote:
Originally Posted by elbarto Try polyfit and polyeval. Code: EDU>> x = sort(rand(1,5))
x =
0.4456 0.4898 0.6463 0.7094 0.7547
EDU>> y = rand(1,5)
y =
0.2760 0.6797 0.6551 0.1626 0.1190
EDU>> p = polyfit(x,y,4)
p =
1.0e+003 *
1.0569 -2.3779 1.9403 -0.6777 0.0857
EDU>> yp=polyval(p,x)
yp =
0.2760 0.6797 0.6551 0.1626 0.1190
EDU>> plot(x,y,'o',x,yp,'k:')
EDU>>
Elbarto | Thank you for your help. I understand most of the polyfit and polyval code. What troubles me the most right now is
"Using an appropriate range of signal to noise ratios, i need to construct the signal for 10 different signal to noise ratios ranging from 10:1 to 0.1:1. I need to generate polynomial fits to the data ranging from order 1 to order 4."
I am not sure how to construct the signal and i am lost with the signal to noise ratio. | 
November 2nd, 2009, 05:42 PM
| | Member | | Join Date: Mar 2007
Posts: 143
Country: Thanks: 20
Thanked 21 Times in 20 Posts
| | I cant help you out much there I am afraid. Do you have the signal processing toolbox installed? will tell you what toolboxes you have available.
Something on this page might be of use Signal Processing Toolbox
Elbarto | 
November 2nd, 2009, 09:40 PM
|  | Grand Panjandrum | | Join Date: Nov 2005 Location: South of England
Posts: 12,279
Country: Thanks: 779
Thanked 4,004 Times in 3,229 Posts
| | Quote:
Originally Posted by ixie99 Hi all. I am new here. I though this would be a good place to ask for some help with my Matlab assignment, because i am completely lost.
I need to explore the detection of a signal in the presence of noise, the signal being the first 90 degrees of a sine wave. I need to analyze how good a fit of a polynomial with order and degree as a function increasing noise.
Using an appropriate range of signal to noise ratios, i need to construct the signal for 10 different signal to noise ratios ranging from 10:1 to 0.1:1. I need to generate polynomial fits to the data ranging from order 1 to order 4.
The last part is to calculate the residuals for each combination and demonstrate when a higher order fit is better than a linear fit.
I really need help on this. Any amount will do.
Thanks | You need to tell us something more about the noise, like its bandwidth .. Or about the signal sampling, or ...
CB
__________________ Truth does not change because it is, or is not, believed by a majority of the people.
Giordano Bruno | 
November 10th, 2009, 09:28 AM
| | Newbie | | Join Date: Nov 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
| | Is that an online program. I nver heard of it | 
November 10th, 2009, 04:28 PM
| | Member | | Join Date: Mar 2007
Posts: 143
Country: Thanks: 20
Thanked 21 Times in 20 Posts
| | Is what an online program?
If you are talking about the signal processing toolbox then it is an optional feature of MATLAB that comes with the recent student versions. I am using 2008b an I have this toolbox available on my install.
Elbarto | | Thread Tools | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | All times are GMT -7. The time now is 08:28 AM. | | |