From: Sarah on 20 Jul 2010 14:03 Is it possible to resample data without having a rate multiplier composed of a rational ratio of two integers? If I were to use the resample function in MATLAB, it asks for p and q to be integers. I have looked at other interpolation and sampling functions and all of them at least ask for a rational number to multiple by the original rate. In my case, I would like to multiply by a number calculated to an accuracy of 0.001. If this was possible, I would be looking at an example p-value of 59.012 and a q-value of 1 for the resample function (which I know is not the required integer values but would result in a rational ratio for p/q). Does anyone have suggestions for how I can deal with this unique case?
From: Steven_Lord on 20 Jul 2010 15:19 "Sarah " <semcmahon(a)jacks.sdstate.edu> wrote in message news:i24od7$47i$1(a)fred.mathworks.com... > Is it possible to resample data without having a rate multiplier composed > of a rational ratio of two integers? If I were to use the resample > function in MATLAB, it asks for p and q to be integers. I have looked at > other interpolation and sampling functions and all of them at least ask > for a rational number to multiple by the original rate. In my case, I > would like to multiply by a number calculated to an accuracy of 0.001. If > this was possible, I would be looking at an example p-value of 59.012 and > a q-value of 1 for the resample function (which I know is not the required > integer values but would result in a rational ratio for p/q). Does anyone > have suggestions for how I can deal with this unique case? Use the RAT function to determine integer values for P and Q that satisfy your tolerance. http://www.mathworks.com/access/helpdesk/help/techdoc/ref/rat.html -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ To contact Technical Support use the Contact Us link on http://www.mathworks.com
From: Sarah on 20 Jul 2010 15:44 "Steven_Lord" <slord(a)mathworks.com> wrote in message <i24sse$pjh$1(a)fred.mathworks.com>... > > > "Sarah " <semcmahon(a)jacks.sdstate.edu> wrote in message > news:i24od7$47i$1(a)fred.mathworks.com... > > Is it possible to resample data without having a rate multiplier composed > > of a rational ratio of two integers? If I were to use the resample > > function in MATLAB, it asks for p and q to be integers. I have looked at > > other interpolation and sampling functions and all of them at least ask > > for a rational number to multiple by the original rate. In my case, I > > would like to multiply by a number calculated to an accuracy of 0.001. If > > this was possible, I would be looking at an example p-value of 59.012 and > > a q-value of 1 for the resample function (which I know is not the required > > integer values but would result in a rational ratio for p/q). Does anyone > > have suggestions for how I can deal with this unique case? > > Use the RAT function to determine integer values for P and Q that satisfy > your tolerance. > > http://www.mathworks.com/access/helpdesk/help/techdoc/ref/rat.html > > -- > Steve Lord > slord(a)mathworks.com > comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ > To contact Technical Support use the Contact Us link on > http://www.mathworks.com >Steve, Thank you for your reply. I can see where your suggestion comes from, but I'm not sure it will help in my case. My original sampling rate was used to determine where the signal frequency fell in the 59-61 Hz range. To obtain the accuracy required by my application, I need to be able to resample at a rate that uses the calculated frequency which is estimated to the thousandth decimal place. I fear that the rat function would just put me back to square one. What I really need is to have a resampling function that isn't based off of an integer or integer ratio multiplication of the original sampling rate. --Sarah
From: Sarah on 20 Jul 2010 16:42 "Sarah " <semcmahon(a)jacks.sdstate.edu> wrote in message <i24ua4$hc$1(a)fred.mathworks.com>... > "Steven_Lord" <slord(a)mathworks.com> wrote in message <i24sse$pjh$1(a)fred.mathworks.com>... > > > > > > "Sarah " <semcmahon(a)jacks.sdstate.edu> wrote in message > > news:i24od7$47i$1(a)fred.mathworks.com... > > > Is it possible to resample data without having a rate multiplier composed > > > of a rational ratio of two integers? If I were to use the resample > > > function in MATLAB, it asks for p and q to be integers. I have looked at > > > other interpolation and sampling functions and all of them at least ask > > > for a rational number to multiple by the original rate. In my case, I > > > would like to multiply by a number calculated to an accuracy of 0.001. If > > > this was possible, I would be looking at an example p-value of 59.012 and > > > a q-value of 1 for the resample function (which I know is not the required > > > integer values but would result in a rational ratio for p/q). Does anyone > > > have suggestions for how I can deal with this unique case? > > > > Use the RAT function to determine integer values for P and Q that satisfy > > your tolerance. > > > > http://www.mathworks.com/access/helpdesk/help/techdoc/ref/rat.html > > > > -- > > Steve Lord > > slord(a)mathworks.com > > comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ > > To contact Technical Support use the Contact Us link on > > http://www.mathworks.com > > >Steve, > Thank you for your reply. I can see where your suggestion comes from, but I'm not sure it will help in my case. My original sampling rate was used to determine where the signal frequency fell in the 59-61 Hz range. To obtain the accuracy required by my application, I need to be able to resample at a rate that uses the calculated frequency which is estimated to the thousandth decimal place. I fear that the rat function would just put me back to square one. What I really need is to have a resampling function that isn't based off of an integer or integer ratio multiplication of the original sampling rate. > --Sarah It looks like rat would do the trick if I didn't have to call it extrinsically in my Embedded MATLAB code. Do you know of any other functions that would give similar results but wouldn't be extrinsic functions in SIMULINK's Embedded MATLAB block? Thanks, Sarah
|
Pages: 1 Prev: What's the best way to write mixed data into CSV? Next: Segmentiation of hair from skin |