Mercurial > octave-nkf
comparison scripts/signal/freqz.m @ 20266:83792dd9bcc1
Use in-place operators in m-files where possible.
* scripts/audio/@audioplayer/set.m, scripts/audio/@audiorecorder/set.m,
scripts/audio/mu2lin.m, scripts/elfun/cosd.m, scripts/general/del2.m,
scripts/general/profexplore.m, scripts/general/quadl.m, scripts/general/rat.m,
scripts/general/rotdim.m, scripts/help/get_first_help_sentence.m,
scripts/help/private/__strip_html_tags__.m, scripts/image/cubehelix.m,
scripts/io/textread.m, scripts/linear-algebra/duplication_matrix.m,
scripts/linear-algebra/housh.m, scripts/linear-algebra/krylov.m,
scripts/linear-algebra/logm.m, scripts/linear-algebra/normest.m,
scripts/linear-algebra/onenormest.m, scripts/optimization/fminsearch.m,
scripts/optimization/lsqnonneg.m, scripts/optimization/qp.m,
scripts/plot/appearance/annotation.m, scripts/plot/appearance/axis.m,
scripts/plot/appearance/legend.m, scripts/plot/appearance/specular.m,
scripts/plot/draw/colorbar.m, scripts/plot/draw/hist.m,
scripts/plot/draw/plotmatrix.m, scripts/plot/draw/private/__stem__.m,
scripts/plot/util/__actual_axis_position__.m,
scripts/plot/util/__gnuplot_drawnow__.m, scripts/plot/util/findobj.m,
scripts/plot/util/print.m, scripts/plot/util/private/__go_draw_axes__.m,
scripts/plot/util/private/__print_parse_opts__.m, scripts/plot/util/rotate.m,
scripts/polynomial/pchip.m, scripts/polynomial/polyaffine.m,
scripts/polynomial/polyder.m, scripts/polynomial/private/__splinefit__.m,
scripts/polynomial/residue.m, scripts/signal/arch_fit.m,
scripts/signal/arch_rnd.m, scripts/signal/bartlett.m,
scripts/signal/blackman.m, scripts/signal/freqz.m, scripts/signal/hamming.m,
scripts/signal/hanning.m, scripts/signal/spectral_adf.m,
scripts/signal/spectral_xdf.m, scripts/signal/stft.m,
scripts/sparse/bicgstab.m, scripts/sparse/cgs.m,
scripts/sparse/private/__sprand_impl__.m, scripts/sparse/qmr.m,
scripts/sparse/sprandsym.m, scripts/sparse/svds.m, scripts/specfun/legendre.m,
scripts/special-matrix/gallery.m, scripts/statistics/base/gls.m,
scripts/statistics/models/logistic_regression.m,
scripts/statistics/tests/kruskal_wallis_test.m,
scripts/statistics/tests/manova.m, scripts/statistics/tests/wilcoxon_test.m,
scripts/time/datevec.m:
Use in-place operators in m-files where possible.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 26 May 2015 21:07:42 -0700 |
parents | f1d0f506ee78 |
children |
comparison
equal
deleted
inserted
replaced
20265:e914b5399c67 | 20266:83792dd9bcc1 |
---|---|
150 ## polyval is much higher and the little bit of time saved isn't | 150 ## polyval is much higher and the little bit of time saved isn't |
151 ## worth the extra code. | 151 ## worth the extra code. |
152 k = max (length (b), length (a)); | 152 k = max (length (b), length (a)); |
153 if (k > n/2 && nargout == 0) | 153 if (k > n/2 && nargout == 0) |
154 ## Ensure a causal phase response. | 154 ## Ensure a causal phase response. |
155 n = n * 2 .^ ceil (log2 (2*k/n)); | 155 n *= 2 .^ ceil (log2 (2*k/n)); |
156 endif | 156 endif |
157 | 157 |
158 if (whole_region) | 158 if (whole_region) |
159 N = n; | 159 N = n; |
160 if (plot_output) | 160 if (plot_output) |
176 | 176 |
177 hb = zeros (n, 1); | 177 hb = zeros (n, 1); |
178 ha = zeros (n, 1); | 178 ha = zeros (n, 1); |
179 | 179 |
180 for i = 1:N:pad_sz | 180 for i = 1:N:pad_sz |
181 hb = hb + fft (postpad (b(i:i+N-1), N))(1:n); | 181 hb += fft (postpad (b(i:i+N-1), N))(1:n); |
182 ha = ha + fft (postpad (a(i:i+N-1), N))(1:n); | 182 ha += fft (postpad (a(i:i+N-1), N))(1:n); |
183 endfor | 183 endfor |
184 | 184 |
185 endif | 185 endif |
186 | 186 |
187 h = hb ./ ha; | 187 h = hb ./ ha; |