help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

freqz / postpad problem


From: Dmitri A. Sergatskov
Subject: freqz / postpad problem
Date: Sat, 15 Apr 2006 17:19:27 -0600

I found a buglet in freqz (octave 2.9.4, Quentin's  rpm for Fedora Core 5).
"test freqz" fails with the following error:

octave:57> test freqz
  ***** test # whole-half consistency
 b = [1 1 1]/3; # 3-sample average
 [h,w] = freqz(b,1,32,'whole');
 assert(h(2:16),conj(h(32:-1:18)),20*eps);
 [h2,w2] = freqz(b,1,16,'half');
 assert(h(1:16),h2,20*eps);
 assert(w(1:16),w2,20*eps);
!!!!! test failed
error: quotient: nonconformant arguments (op1 is 1x32, op2 is 32x1)

The culprit is the follqwing code (lines 134 and 135 in freqz.m):


    hb = fft (postpad (b, n));
    ha = fft (postpad (a, n));

(and later)

    h = hb ./ ha;

The problem here is that when b is a vector (e.g. 1:m) postpad
and consecuetly fft return 1:n vector as well, but if a is just a number
then postpad (and fft later) return n:1 vector.

I really do not know what would be the best fix. In particular I am
not sure that postpad behavior is OK.

Sincerely,

Dmitri.
--



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]