How to import signal in SPTool (in Signal Analysis Application)?
28 次查看(过去 30 天)
显示 更早的评论
Hello, I have a basic question on using SPTool signal analysis. I want to import an unevenly sampled time series signal. I have one vector y represent the measured data, and one vector x represents sampling time. How can I import x, avoiding assign one signal sampling frequency.
Thanks!
0 个评论
回答(1 个)
Dimitris Iliou
2017-4-21
If I understand your question correctly, you are trying to use SPTool and import a single signal x, that has different sample times that are included in vector y.
SPTool will only allow you to have a scalar value in the Sampling Frequency field.
You can import the signal from the SPTool UI or create a signal component programmatically first. In both cases you will get the same outcome: Sampling Frequency needs to be scalar.
To create a sptool component programmatically, you can use the following command:
SignalTest = sptool('create','Signal',x,y,'test')
When you run this command you will get the following error:
Error using sptool (line 683)
Found the following error: The sampling frequency must be a positive real scalar.
In case you do create a component and then you try to change the Sampling Frequency to a vector, you will not get the desired result.
For example if you run:
SignalTest= sptool('create','Signal',x,1,'test');
SignalTest.Fs = y;
the resulting Sampling Frequency when you try to import the 'SignalTest' through SPTool, will be all the values of the vector concatenated into a scalar value.
In summary, the Sampling Frequency needs to be a scalar when using the SPTool.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!