-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathframes.v
50 lines (33 loc) · 1.18 KB
/
frames.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//---------------------First part: creating frams----------------------------------------
//outputs vectorFrames and num_slices
// Max number of slices that can be obtained: Rounded! (length of input - window size) / hop
num_slices <=
hop <= 256;
// space between windows, they have as 256
// local changing of the source file to truncate and make sure only integer # of hop
x <=
// Size of the windows, they have as 1024
windowSize <=
// Get vectorFrames
for (i = 0; i < num_slices + 1; i = i+1)
begin
iTimeStart <= (i - 1) * hop + 1;
iTimeEnd <= (i - 1) * hop + windowSize;
vectorFrames[i,:] <= x[iTimeStart,iTimeEnd];
end
//--------------------Second part: fusing the frames together------------------------------
//inputs: frameMatrix, has all of the frames
// hop
//outputs: vectorTime:vector from adding frames
// Get number of frames
num_frames <=
// Get size of each frame
size_frames <=
//init
timeIndex <= 1;
// Loop for every fram and operlap-add
for (j = 0; j < num_frames; j = j+1)
begin
vectorTime[timeIndex:timeIndex + size_frames - 1] <= vectorTime[timeIndex:timeIndex + size_frames - 1] + frameMatrix[index,:];
timeIndex = timeIndex + hop;
end