resampling signals in matlab 2012b
2 次查看(过去 30 天)
显示 更早的评论
m
2013-8-16
hello i want to downsampling a signal with 173HZ and 23.6s to 120HZ ,can i do it with matlab 2012b ?
采纳的回答
m
2013-8-16
17 个评论
Jan
2013-8-16
编辑:Jan
2013-8-16
Matlab help says:
y = resample(x,p,q) resamples the sequence in vector x at p/q times the original sampling rate, using a polyphase filter implementation. p and q must be positive integers. The length of y is equal to ceil(length(x)*p/q). If x is a matrix, resample works down the columns of x.
i.e. in your case p=120 and q=173, so:
x_resampled = resample( x, 120, 172 )
should do the trick.
m
2013-8-16
thanks for your answer,i run it but get this error: "_Too many input arguments._" do you know this error? my x variable is eq 4096
Jan
2013-8-16
Before you start uploading files: how do you load the signal into the Matlab environment and what kind of signal is it that you are dealing with?
m
2013-8-16
i want to import the eeg signal ,the file has 4097 numbers,i use import from menu then import it to a variable,and the file has one column... i think matlab has a bug with this function because when i try to run sample code of 'resample' i see this error again !
Jan
2013-8-16
In the Matlab command line type whos and post the output.
Also type the variable name and post that output, too.
m
2013-8-16
my input command : y=resample(inputsig,120,173); output : Error using resample Too many input arguments.
my enviroment report : Name Size Bytes Class Attributes
inputsig 4097x1 32776 double
y 1x4098 32784 double
m
2013-8-16
ofcourse, the output is :E:\edu\ARSHAD AI\classes\EVALUATIONARY ALGORITHMS\Project\Steps\Data\resample.m
do you think the path is so long?
Jan
2013-8-16
No, there is a function in your project that is called resample too which hides Matlab's resample function. Unload the path you just posted from your environment and try to call resample again.
m
2013-8-16
编辑:m
2013-8-16
E:\edu\ARSHAD AI\classes\EVALUATIONARY ALGORITHMS\Project\Steps\Data\resample.m C:\Program Files\MATLAB\R2012b\toolbox\matlab\timeseries\@timeseries\resample.m C:\Program Files\MATLAB\R2012b\toolbox\ident\ident\@iddata\resample.m C:\Program Files\MATLAB\R2012b\toolbox\simbio\simbio\@SimData\resample.m C:\Program Files\MATLAB\R2012b\toolbox\matlab\timeseries\@tscollection\resample.m C:\Program Files\MATLAB\R2012b\toolbox\signal\signal\resample.m
m
2013-8-16
after i delete my resample function : C:\Program Files\MATLAB\R2012b\toolbox\signal\signal\resample.m
更多回答(1 个)
Jan
2013-8-16
If you have the Signalprocessing Toolbox use resample() or decimate()
If not, look at interp1()
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!发生错误
由于页面发生更改,无法完成操作。请重新加载页面以查看其更新后的状态。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
亚太
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)