function deconv
显示 更早的评论
the function decov this programmed to mark erreur when one of tha values inside the matrix is zero.How i can change the algorithm of this function?
回答(1 个)
Paulo Silva
2011-2-24
Do this at your own risk and there's no warranty that the function will work correctly after the change
edit deconv
put one % before the error line
error('MATLAB:deconv:ZeroCoef1', 'First coefficient of A must be non-zero.')
With the % the line won't be evaluated thus the error command doesn't cause the function to abort.
%error('MATLAB:deconv:ZeroCoef1', 'First coefficient of A must be non-zero.')
And save the file.
Another way that should work is to replace the zero value with a small value like 1e-6, it's probably better to replace than to change the deconv function.
It's just the first value that can't be zero, so you go to your data and change the first value like this
Mydata(1)=1e-6 %MyData should be replaced by your variable name
4 个评论
Sofia degli Alessandri
2011-3-8
I'm having the same issue as carlos- I tried using your idea of "Mydata(1)=1e-6 %MyData should be replaced by your variable name" but now I just receive another error message:
??? Error using ==> filter
First two arguments must be vectors.
Error in ==> deconv at 32
[q,zf] = filter(b, a, [1 zeros(1,nb-na)]);
I'm trying to extract a HRIR from a convolved signal by deconvolving it with the test signal. I've wavread the two .wav files in as x and y and have followed the doc on deconv.
If anyone had suggestions they would be greatly appreciated!
Walter Roberson
2011-3-8
What are size(b) and size(a) ? If they are not vectors, we are going to need the code that creates them (and possibly some code before that too) in order to figure out why they are not vectors.
Did you possibly accidentally use
a=1e-6
instead of
a(1)=1e-6
??
Sofia degli Alessandri
2011-3-8
size(b) and size(a) are both : 1852200 2
I did use a(1)=1e-6 but the error message shown above still appears.
Thank you for all the help
Walter Roberson
2011-3-8
Well, like it says, the first two arguments must be vectors. You are using arrays.
If you are using a sound read in from a file, keep in mind that most audio files are stereo, with (:,1) being the left channel and (:,2) being the right channel. You appear to be trying to deconv() a stereo signal, which deconv() cannot handle directly.
类别
在 帮助中心 和 File Exchange 中查找有关 Filter Design 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!