History

Add extra comment to make_src_filter.m.

Erik de Castro Lopo committed 22 years ago

Commit 9d67a321 parent 02e186f2 files · +51 −1Browse files

Unified · Split

2 files
  1. FIR-POLY/timeline.m +50 −0
  2. make_src_filter.m +1 −1
FIR-POLY/timeline.m+50−0
@@ -0,0 +1,50 @@
1function [t, mt, w] = timeline (len, stretch)
2
3
4if (stretch < 0 || stretch > 1)
5 error ("stretch out of range [0, 1].\n");
6 endif
7
8# Mofified time
9
10x_w = 0.2 ;
11x = [-0.5 -0.2 0.2 0.5];
12y = [-0.5 -0.4 -0.1 0.5];
13
14p = polyfit (x, y, 4);
15
16t = linspace (-0.5, 0.5, 100);
17y = polyval (p,t);
18plot (t, y)
19return
20
21mt = ((1 - stretch) * t + stretch * t.^2) - 0.5 ;
22
23
24# Basically a Nuttall indow
25ak = [0.42323 0.49755 0.07922] ;
26
27w = zeros (1, len) ;
28
29k = 0 ;
30for a = ak,
31 w = w + a * cos (2 * pi * k * mt) ;
32 k += 1 ;
33 endfor
34
35w = fliplr (w / len) ;
36
37# Linear t
38
39t = linspace (-(len-2)/2, (len-2)/2, len) / len ;
40
41
42end
43
44# Do not edit or modify anything in this comment block.
45# The following line is a file identity tag for the GNU Arch
46# revision control system.
47#
48# arch-tag: 830f701e-5e9c-478a-a929-609513d4b1a6
49
50
make_src_filter.m+1−1
@@ -10,7 +10,7 @@ function f = make_src_filter (cycles, increment, atten, filename) · 9 unmodified lines
10#=======================================================================10#=======================================================================
11 11
12if nargin < 3,12if nargin < 3,
13 error ("Try make_filter (12, 32, 88)") ;13 error ('Try make_filter (12, 32, 88, "output.txt")') ;
14 endif14 endif
15 15
16if nargin < 4,16if nargin < 4,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t