unable to use Low pass filter on experimental data
2 次查看(过去 30 天)
显示 更早的评论
Hi there
I am trying to filter som data but i get the warning: " Unable to use a value of type 'digitalFilter' as an index."
sfilter = Fx';
noise = 0.5*randn(size(tA));
xfilter = noise + sfilter;
figure()
plot(xfilter)
dfilter = designfilt('lowpassfir', 'FilterOrder', 5, 'CutoffFrequency', 11, 'SampleRate', fs);
yfilter = filter(dfilter,xfilter);
plot(yfilter)
Where,
sfilter is a 1 x 59992 row vector
Fx' is a 1 x 59992 row vector
noise is a 1 x 59992 row vector
xfilter is a 1 x 59992 row vector
tA is a 1 x 59992 row vector
I hope you can help
0 个评论
采纳的回答
Star Strider
2019-9-14
When I substitute some vectors for the missing data, the posted code runs for me without error.
The filter function should take a digitalFilter object.
Do you have a variable called ‘filter’?
To see if you do, run this:
q = which('filter','-all')
if the first result is:
filter is a variable.
You have found the problem. (This is called ‘overshadowing’ a MATLAB function.) Ths solution is to rename the variable.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Digital Filter Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!