I know some people who work on things like this, so if you want some references let me know and I will ask them. But I'll just point out that if you have a problem where pulses are piling up and you want to extract information about each pulse, this can be a tricky problem. I don't know what you are really trying to accomplish, so it's hard to give further advice. The output is: maximum error for length(v) = 100 is 0.000000 Convolution is a mathematical operation that combines two signals and outputs a third signal. Its not documented very well if at all, but when there are an odd number of extra elements on the ends, conv seems to cut out one more unused element on the left hand side than the right hand side. Here's a simple demonstration using random vectors: v = random('uniform', 1,2,100,1) įprintf('maximum error for length(v) = 100 is %f\n', max(conv(u, q) r - v))įprintf('maximum error for length(v) = 1000 is %f\n', max(conv(u, q) r - v)) For the same option, conv picks the centermost 5 (in this case) elements. It makes sense all MATLAB needs to do is divide everything by the same number. Note that if you put only one non-zero element into your spike, this behavior doesn't happen: the error is always zero. Gradually increase the length of spike the error will get larger and larger. I get 6.75e227, which is not zero -) Next try changing the length of spike to 6000 you will get a small number (~1e-15). To check this run: which -all conv If my guess is correct, rename or remove your conv.m script. Max(conv(k1, reconSpike1) rem - calcium1) Put the following at the end of your script: =deconv(calcium1, k1) in which sjw, can be plotted using the plot function in Matlab. Per MATLAB documentation, if = deconv(v,u), then v = conv(u,q) r must also hold (i.e., the output of deconv should always satisfy this). One first defines a column vector of the roots (-s1, -s2, etc.). I suspect it's floating point precision due to all the divisions and subtractions that take place during the deconvolution, but it might be worth contacting MathWorks directly to ask what they think. MATLAB conv function Let f(n) u(n) u(n - 5) g(n) r(n) 2r(n 5) r(n 10). You are running into either a problem with MATLAB's deconvolution algorithm, or floating point precision problems (or maybe both). Algebraically, convolution is the same operation as multiplying the polynomials whose coefficients are the.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |