From: Wayne King on 8 May 2010 16:33 MatlaBeginner <shoorideh(a)gmail.com> wrote in message <4ecdafae-ce3c-4fb3-8519-5abe39a434d8(a)k19g2000yqm.googlegroups.com>... > On May 8, 11:58 pm, "Wayne King" <wmkin...(a)gmail.com> wrote: > > MatlaBeginner <shoori...(a)gmail.com> wrote in message <664516ef-e965-4475-8be7-658a3ebd7...(a)j33g2000yqn.googlegroups.com>... > > > On May 8, 11:24 pm, "Wayne King" <wmkin...(a)gmail.com> wrote: > > > > MatlaBeginner <shoori...(a)gmail.com> wrote in message <79bc9243-546e-4a1d-9fad-602d11154...(a)a21g2000yqn.googlegroups.com>... > > > > > Hi everyone! > > > > > I am beginner in MATLAB programming and i need your help. > > > > > my question is: > > > > > I have 3 sinusoidal signal > > > > > and i add a random noise to sum of these signals. > > > > > s_1=1*sin(2*pi*5*t); % create a 5 Hz sine wave > > > > > s_2=.5*sin(2*pi*10*t); % create a 10 Hz sine wave > > > > > s_3=3*sin(2*pi*1*t); % create a 1 Hz sine wave > > > > > sigsum=(s_1+s_2+s_3)/4.5; %sum of these signals > > > > > sigmix1=awgn(sigsum,20); %add noise to the sum. > > > > > > > I want to write a m-file compute estimate of a 2nd and a 20th order AR > > > > > model parameters of sigmix1 using the following methods: > > > > > -Burg > > > > > -Covariance > > > > > -Modified covariance > > > > > -Yule-Walker > > > > > > Hi, You're in luck! Those algorithms are all available in the Signal Processing Toolbox. See > > > > > > >>doc aryule > > > > >>doc arcov > > > > >>doc armcov > > > > >>arburg > > > > > > Hope that helps, > > > > Wayne > > > > > thanks > > > but i want to write m-file and i dont want to use toolboxes and i dont > > > know how to relate toolbox to matlab editor too. > > > my second problem is that i dont kow exactly what should i find?! > > > > Hi, Are you saying that you just want to use base MATLAB functions/objects in coding these algorithms? In that case you won't be able to avail yourself of some convenient Signal Processing Toolbox functions like corrmtx and levinson. > > > Hi, this is what exactly asked to do."write a m-file to compute > estimate of a 2nd and a 20th order AR model parameters of sigmix1 > using the following methods -Burg, -Covariance,-Modified covariance,- > Yule-Walker " > > may be i can use aryule,arcov,armcov,arburg that you mentioned but > i dont know how can i use them in my m-file: > s_1=1*sin(2*pi*5*t); % create a 5 Hz sine wave > s_2=.5*sin(2*pi*10*t); % create a 10 Hz sine wave > s_3=3*sin(2*pi*1*t); % create a 1 Hz sine wave > sigsum=(s_1+s_2+s_3)/4.5; %sum of these signals > sigmix1=awgn(sigsum,20); %add noise to the sum. > > thanks Did you read the documentation for these functions? The documentation shows you examples of how to call the functions. You can call them from your MATLAB program just as you would call them from the command line (as shown in the examples). The difference is that the inputs to these functions, the data and the autoregressive model order, have to be provided as inputs to your MATLAB program, or computed within your function and then passed to aryule(), arburg(), etc. You should read the section of the MATLAB User's Guide -> Programming Fundamentals -> Functions and Scripts Wayne
From: Steven Lord on 9 May 2010 23:10 "MatlaBeginner" <shoorideh(a)gmail.com> wrote in message news:4ecdafae-ce3c-4fb3-8519-5abe39a434d8(a)k19g2000yqm.googlegroups.com... On May 8, 11:58 pm, "Wayne King" <wmkin...(a)gmail.com> wrote: *snip* > Hi, this is what exactly asked to do."write a m-file to compute > estimate of a 2nd and a 20th order AR model parameters of sigmix1 > using the following methods -Burg, -Covariance,-Modified covariance,- > Yule-Walker " > > may be i can use aryule,arcov,armcov,arburg that you mentioned but > i dont know how can i use them in my m-file: > s_1=1*sin(2*pi*5*t); % create a 5 Hz sine wave > s_2=.5*sin(2*pi*10*t); % create a 10 Hz sine wave > s_3=3*sin(2*pi*1*t); % create a 1 Hz sine wave > sigsum=(s_1+s_2+s_3)/4.5; %sum of these signals > sigmix1=awgn(sigsum,20); %add noise to the sum. Ah. By "this is what exactly asked to do" am I to assume that you've been assigned to do this for your homework or a project in a class? If so, the general procedure here on CSSM for homework problems is that you post the code you've written to solve the problem and post a specific question about where you're stuck, and we help you with that specific question. After all, homework questions are generally intended to help you learn, and if we gave you the answer that wouldn't help you learn. -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
From: TideMan on 10 May 2010 00:36
On May 10, 3:10 pm, "Steven Lord" <sl...(a)mathworks.com> wrote: > "MatlaBeginner" <shoori...(a)gmail.com> wrote in message > > news:4ecdafae-ce3c-4fb3-8519-5abe39a434d8(a)k19g2000yqm.googlegroups.com... > On May 8, 11:58 pm, "Wayne King" <wmkin...(a)gmail.com> wrote: > > *snip* > > > Hi, this is what exactly asked to do."write a m-file to compute > > estimate of a 2nd and a 20th order AR model parameters of sigmix1 > > using the following methods -Burg, -Covariance,-Modified covariance,- > > Yule-Walker " > > > may be i can use aryule,arcov,armcov,arburg that you mentioned but > > i dont know how can i use them in my m-file: > > s_1=1*sin(2*pi*5*t); % create a 5 Hz sine wave > > s_2=.5*sin(2*pi*10*t); % create a 10 Hz sine wave > > s_3=3*sin(2*pi*1*t); % create a 1 Hz sine wave > > sigsum=(s_1+s_2+s_3)/4.5; %sum of these signals > > sigmix1=awgn(sigsum,20); %add noise to the sum. > > Ah. By "this is what exactly asked to do" am I to assume that you've been > assigned to do this for your homework or a project in a class? > > If so, the general procedure here on CSSM for homework problems is that you > post the code you've written to solve the problem and post a specific > question about where you're stuck, and we help you with that specific > question. After all, homework questions are generally intended to help you > learn, and if we gave you the answer that wouldn't help you learn. > > -- > Steve Lord > sl...(a)mathworks.com > comp.soft-sys.matlab (CSSM) FAQ:http://matlabwiki.mathworks.com/MATLAB_FAQ It never ceases to amaze me how dumb these homework cheats are, I read that "this is what exactly asked to do" too and picked immediately it was homework. Maybe that's why they have to cheat. They don't even have enough guile to disguise the fact that it's homework. |