is there a bandwidth limit on the bandstop filter

9 次查看(过去 30 天)
I have the following code which is stopping a super narrow band on a signal. It runs but won't complete and locks up matlab. I assume becasue I'm pushing the filter past it's limit. Can anyone confirm this?
y = bandstop(signal, [4500 950000], 5e9);
Thanks
  4 个评论
Walter Roberson
Walter Roberson 2019-6-12
On my system, with 4 CPUs, that runs 4 threads (automatically) doing the calculation. The amount of memory involved is not much comparatively -- the entire MATLAB process is sitting at less than 1.5 gigabytes including the desktop.
I ran 1 million earlier and it took a bit but finished. I am timing 10M now.

请先登录,再进行评论。

采纳的回答

Star Strider
Star Strider 2019-6-12
The easiest way to see what’s going on with it is to use fvtool to look at it, and to give it a short random signal to look at the output:
signal = rand(1, 1E+4);
[y,df] = bandstop(signal, [4500 950000], 5e9);
fvtool(df)
figure
plot(y)
It appears to be a well-designed filter, and works with a random signal. I suspect that something about your ‘signal’ vector could be part of the problem, possibly its amplitude, since the output of the random signal (with an amplitude between 0 and 1) produces an output on the order of . The normalised frequency of the stopband center frequency is about . (In my experience, this is a bit extreme.)
In situations like this, it’s sometimes worthwhile to design both a lowpass filter and a highpass filter, and then add the output vectors. (There is no way to cascade them, since the output of one filter will not overlap with the output of the other filter.)
The problem does not appear to be with the filter itself, since the fvtool analysis suggests that it’s stable and works well.
  10 个评论
STEPHEN BARRETT
STEPHEN BARRETT 2019-6-14
The denoising works quite well, although I have to admit I don't really know what it's actually doing. It also decreases the peaks height much more than the amplitude of the actual noise in the flat sections. So I'm not really sure how much of my actual signal is getting filtered out too.
tim.png
Star Strider
Star Strider 2019-6-14
Part of the problem is that wavelets will find it difficult to differentiate completely the spikes from the noise unless you tell them to. That’s simply the nature of wavelets. I¹ve not worked with wavelets in a while (I would have to back and review my wavelet references), however concentrating on the higher-frequency wavelets (that would eliminate the noise) might be worthwhile, and would not attenuate the low-frequency parts of your signal (spikes). For this, you would use wavelet filters.

请先登录,再进行评论。

更多回答(0 个)

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by