Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
compressed_sensing
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Erik Strand
compressed_sensing
Commits
de5833e8
Commit
de5833e8
authored
May 9, 2019
by
Erik Strand
Browse files
Options
Downloads
Patches
Plain Diff
Perform gradient descent
parent
ff76027e
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
main.cpp
+11
-3
11 additions, 3 deletions
main.cpp
plotter.py
+6
-0
6 additions, 0 deletions
plotter.py
with
17 additions
and
3 deletions
main.cpp
+
11
−
3
View file @
de5833e8
...
@@ -119,9 +119,17 @@ int main() {
...
@@ -119,9 +119,17 @@ int main() {
Vector
subset_differences
=
subset_sample_values
-
subset_recovered_sample_values
;
Vector
subset_differences
=
subset_sample_values
-
subset_recovered_sample_values
;
Scalar
loss
=
subset_differences
.
squaredNorm
();
Scalar
loss
=
subset_differences
.
squaredNorm
();
Vector
gradient
=
-
2
*
subset_dct_matrix
*
subset_differences
;
Vector
gradient
=
-
2
*
subset_dct_matrix
*
subset_differences
;
constexpr
Scalar
learning_rate
=
0.1
;
std
::
cout
<<
loss
<<
'\n'
;
while
(
loss
>
1e-6
)
{
std
::
cout
<<
gradient
<<
'\n'
;
recovered_dct
-=
learning_rate
*
gradient
;
recovered_sample_values
=
dct_matrix
.
transpose
()
*
recovered_dct
;
subset_recovered_sample_values
=
vector_subset
(
recovered_sample_values
,
subset_indices
);
subset_differences
=
subset_sample_values
-
subset_recovered_sample_values
;
loss
=
subset_differences
.
squaredNorm
();
gradient
=
-
2
*
subset_dct_matrix
*
subset_differences
;
//std::cout << loss << '\n';
}
python_print
(
"dct_e"
,
recovered_dct
);
return
0
;
return
0
;
}
}
This diff is collapsed.
Click to expand it.
plotter.py
+
6
−
0
View file @
de5833e8
...
@@ -7,6 +7,7 @@ dct = np.array([0.0493937, 1.53249, 0.0703373, 1.58311, 0.071832, 1.69718, 0.074
...
@@ -7,6 +7,7 @@ dct = np.array([0.0493937, 1.53249, 0.0703373, 1.58311, 0.071832, 1.69718, 0.074
recovered_sample_values
=
np
.
array
([
3.71932e-15
,
0.475338
,
0.917539
,
1.29619
,
1.5861
,
1.76932
,
1.83651
,
1.78761
,
1.6316
,
1.38558
,
1.0731
,
0.721928
,
0.361558
,
0.0205522
,
-
0.27594
,
-
0.508314
,
-
0.664077
,
-
0.738727
,
-
0.735864
,
-
0.666533
,
-
0.547871
,
-
0.401193
,
-
0.249706
,
-
0.116065
,
-
0.0200166
,
0.0236569
,
0.00668195
,
-
0.0718098
,
-
0.205127
,
-
0.379618
,
-
0.575975
,
-
0.771114
,
-
0.94046
,
-
1.06042
,
-
1.1108
,
-
1.07697
,
-
0.951487
,
-
0.73516
,
-
0.43726
,
-
0.0750177
,
0.327653
,
0.742071
,
1.13718
,
1.48217
,
1.7492
,
1.91577
,
1.96681
,
1.89599
,
1.70642
,
1.41042
,
1.02857
,
0.588008
,
0.120163
,
-
0.341839
,
-
0.765935
,
-
1.12376
,
-
1.39294
,
-
1.5588
,
-
1.61544
,
-
1.56598
,
-
1.42199
,
-
1.20225
,
-
0.930797
,
-
0.634626
,
-
0.341124
,
-
0.0755387
,
0.141293
,
0.294754
,
0.377636
,
0.390584
,
0.341783
,
0.245913
,
0.122481
,
-
0.00631234
,
-
0.117955
,
-
0.19203
,
-
0.212412
,
-
0.169044
,
-
0.0591181
,
0.112454
,
0.333336
,
0.584794
,
0.843377
,
1.08309
,
1.27787
,
1.40408
,
1.44291
,
1.38232
,
1.21838
,
0.95598
,
0.608661
,
0.197701
,
-
0.249515
,
-
0.701696
,
-
1.12623
,
-
1.49192
,
-
1.77159
,
-
1.94442
,
-
1.99773
,
-
1.92798
,
-
1.74113
,
-
1.45207
,
-
1.08332
,
-
0.663067
,
-
0.222778
,
0.205515
,
0.591886
,
0.910992
,
1.14409
,
1.28044
,
1.31795
,
1.26307
,
1.12989
,
0.938508
,
0.713012
,
0.478999
,
0.261091
,
0.0805585
,
-
0.0466774
,
-
0.11149
,
-
0.112311
,
-
0.0551393
,
0.0472029
,
0.176484
,
0.311019
,
0.427974
,
0.505792
,
0.526522
,
0.477802
,
0.354329
,
0.158647
,
-
0.0988122
,
-
0.400459
,
-
0.722977
,
-
1.03934
,
-
1.32121
,
-
1.54155
,
-
1.67714
,
-
1.71079
,
-
1.63312
,
-
1.44356
,
-
1.15069
,
-
0.771708
,
-
0.33113
,
0.14113
,
0.6122
,
1.04895
,
1.42074
,
1.70194
,
1.87404
,
1.9271
,
1.86053
,
1.68299
,
1.41149
,
1.06984
,
0.686454
,
0.291854
,
-
0.0840174
,
-
0.414358
,
-
0.677735
,
-
0.859784
,
-
0.954231
,
-
0.963144
,
-
0.896411
,
-
0.770496
,
-
0.606599
,
-
0.428405
,
-
0.259632
,
-
0.121617
,
-
0.0311657
,
0.00112032
,
-
0.0281042
,
-
0.11461
,
-
0.247029
,
-
0.408011
,
-
0.575983
,
-
0.727348
,
-
0.838913
,
-
0.890317
,
-
0.866221
,
-
0.75805
,
-
0.565119
,
-
0.295029
,
0.0367266
,
0.407896
,
0.791266
,
1.15696
,
1.47502
,
1.71807
,
1.86376
,
1.89685
,
1.81066
,
1.60779
,
1.30007
,
0.907671
,
0.457475
,
-
0.019091
,
-
0.488655
,
-
0.918654
,
-
1.28001
,
-
1.54948
,
-
1.71149
,
-
1.75931
,
-
1.69539
,
-
1.53092
,
-
1.28466
,
-
0.981105
,
-
0.648113
,
-
0.314394
,
-
0.00689592
,
0.25156
,
0.444213
,
0.561694
,
0.602629
,
0.573475
,
0.487607
,
0.363754
,
0.223933
,
0.0910946
,
-
0.0133094
,
-
0.0715908
,
-
0.0717057
,
-
0.00857246
,
0.115302
,
0.289952
,
0.498828
,
0.720336
,
0.929905
,
1.10238
,
1.21454
,
1.24743
,
1.18842
,
1.03264
,
0.783761
,
0.453978
,
0.0632207
,
-
0.36236
,
-
0.792506
,
-
1.19536
,
-
1.54017
,
-
1.79994
,
-
1.95375
,
-
1.9886
,
-
1.9006
,
-
1.69531
,
-
1.38735
,
-
0.999124
,
-
0.559002
,
-
0.0988865
,
0.348445
])
recovered_sample_values
=
np
.
array
([
3.71932e-15
,
0.475338
,
0.917539
,
1.29619
,
1.5861
,
1.76932
,
1.83651
,
1.78761
,
1.6316
,
1.38558
,
1.0731
,
0.721928
,
0.361558
,
0.0205522
,
-
0.27594
,
-
0.508314
,
-
0.664077
,
-
0.738727
,
-
0.735864
,
-
0.666533
,
-
0.547871
,
-
0.401193
,
-
0.249706
,
-
0.116065
,
-
0.0200166
,
0.0236569
,
0.00668195
,
-
0.0718098
,
-
0.205127
,
-
0.379618
,
-
0.575975
,
-
0.771114
,
-
0.94046
,
-
1.06042
,
-
1.1108
,
-
1.07697
,
-
0.951487
,
-
0.73516
,
-
0.43726
,
-
0.0750177
,
0.327653
,
0.742071
,
1.13718
,
1.48217
,
1.7492
,
1.91577
,
1.96681
,
1.89599
,
1.70642
,
1.41042
,
1.02857
,
0.588008
,
0.120163
,
-
0.341839
,
-
0.765935
,
-
1.12376
,
-
1.39294
,
-
1.5588
,
-
1.61544
,
-
1.56598
,
-
1.42199
,
-
1.20225
,
-
0.930797
,
-
0.634626
,
-
0.341124
,
-
0.0755387
,
0.141293
,
0.294754
,
0.377636
,
0.390584
,
0.341783
,
0.245913
,
0.122481
,
-
0.00631234
,
-
0.117955
,
-
0.19203
,
-
0.212412
,
-
0.169044
,
-
0.0591181
,
0.112454
,
0.333336
,
0.584794
,
0.843377
,
1.08309
,
1.27787
,
1.40408
,
1.44291
,
1.38232
,
1.21838
,
0.95598
,
0.608661
,
0.197701
,
-
0.249515
,
-
0.701696
,
-
1.12623
,
-
1.49192
,
-
1.77159
,
-
1.94442
,
-
1.99773
,
-
1.92798
,
-
1.74113
,
-
1.45207
,
-
1.08332
,
-
0.663067
,
-
0.222778
,
0.205515
,
0.591886
,
0.910992
,
1.14409
,
1.28044
,
1.31795
,
1.26307
,
1.12989
,
0.938508
,
0.713012
,
0.478999
,
0.261091
,
0.0805585
,
-
0.0466774
,
-
0.11149
,
-
0.112311
,
-
0.0551393
,
0.0472029
,
0.176484
,
0.311019
,
0.427974
,
0.505792
,
0.526522
,
0.477802
,
0.354329
,
0.158647
,
-
0.0988122
,
-
0.400459
,
-
0.722977
,
-
1.03934
,
-
1.32121
,
-
1.54155
,
-
1.67714
,
-
1.71079
,
-
1.63312
,
-
1.44356
,
-
1.15069
,
-
0.771708
,
-
0.33113
,
0.14113
,
0.6122
,
1.04895
,
1.42074
,
1.70194
,
1.87404
,
1.9271
,
1.86053
,
1.68299
,
1.41149
,
1.06984
,
0.686454
,
0.291854
,
-
0.0840174
,
-
0.414358
,
-
0.677735
,
-
0.859784
,
-
0.954231
,
-
0.963144
,
-
0.896411
,
-
0.770496
,
-
0.606599
,
-
0.428405
,
-
0.259632
,
-
0.121617
,
-
0.0311657
,
0.00112032
,
-
0.0281042
,
-
0.11461
,
-
0.247029
,
-
0.408011
,
-
0.575983
,
-
0.727348
,
-
0.838913
,
-
0.890317
,
-
0.866221
,
-
0.75805
,
-
0.565119
,
-
0.295029
,
0.0367266
,
0.407896
,
0.791266
,
1.15696
,
1.47502
,
1.71807
,
1.86376
,
1.89685
,
1.81066
,
1.60779
,
1.30007
,
0.907671
,
0.457475
,
-
0.019091
,
-
0.488655
,
-
0.918654
,
-
1.28001
,
-
1.54948
,
-
1.71149
,
-
1.75931
,
-
1.69539
,
-
1.53092
,
-
1.28466
,
-
0.981105
,
-
0.648113
,
-
0.314394
,
-
0.00689592
,
0.25156
,
0.444213
,
0.561694
,
0.602629
,
0.573475
,
0.487607
,
0.363754
,
0.223933
,
0.0910946
,
-
0.0133094
,
-
0.0715908
,
-
0.0717057
,
-
0.00857246
,
0.115302
,
0.289952
,
0.498828
,
0.720336
,
0.929905
,
1.10238
,
1.21454
,
1.24743
,
1.18842
,
1.03264
,
0.783761
,
0.453978
,
0.0632207
,
-
0.36236
,
-
0.792506
,
-
1.19536
,
-
1.54017
,
-
1.79994
,
-
1.95375
,
-
1.9886
,
-
1.9006
,
-
1.69531
,
-
1.38735
,
-
0.999124
,
-
0.559002
,
-
0.0988865
,
0.348445
])
subset_sample_times
=
np
.
array
([
0.000200803
,
0.000240964
,
0.000281124
,
0.000321285
,
0.000441767
,
0.00064257
,
0.000883534
,
0.00100402
,
0.00104418
,
0.00116466
,
0.00120482
,
0.00124498
,
0.00144578
,
0.00148594
,
0.00164659
,
0.00180723
,
0.00184739
,
0.00192771
,
0.00200803
,
0.00212851
,
0.00240964
,
0.00248996
,
0.00261044
,
0.00289157
,
0.00293173
,
0.00305221
,
0.00313253
,
0.00317269
,
0.00321285
,
0.00325301
,
0.00333333
,
0.00345382
,
0.00369478
,
0.00373494
,
0.0037751
,
0.00389558
,
0.00405622
,
0.00413655
,
0.00425703
,
0.00429719
,
0.00433735
,
0.00437751
,
0.00441767
,
0.00449799
,
0.00453815
,
0.00465863
,
0.0046988
,
0.00473896
,
0.00481928
,
0.00485944
,
0.0048996
,
0.00518072
,
0.00522088
,
0.0053012
,
0.00554217
,
0.00570281
,
0.00574297
,
0.00586345
,
0.00626506
,
0.00630522
,
0.00634538
,
0.00646586
,
0.00658635
,
0.00662651
,
0.00670683
,
0.00674699
,
0.00694779
,
0.00698795
,
0.00702811
,
0.00706827
,
0.00710843
,
0.00714859
,
0.00718876
,
0.00726908
,
0.00730924
,
0.00742972
,
0.0075502
,
0.00763052
,
0.00771084
,
0.00779116
,
0.00791165
,
0.00799197
,
0.00807229
,
0.00811245
,
0.00815261
,
0.00819277
,
0.00823293
,
0.00827309
,
0.00839357
,
0.00843373
,
0.00883534
,
0.00891566
,
0.00903614
,
0.00923695
,
0.00927711
,
0.00935743
,
0.00963855
,
0.00975904
,
0.00983936
,
0.01
])
subset_sample_times
=
np
.
array
([
0.000200803
,
0.000240964
,
0.000281124
,
0.000321285
,
0.000441767
,
0.00064257
,
0.000883534
,
0.00100402
,
0.00104418
,
0.00116466
,
0.00120482
,
0.00124498
,
0.00144578
,
0.00148594
,
0.00164659
,
0.00180723
,
0.00184739
,
0.00192771
,
0.00200803
,
0.00212851
,
0.00240964
,
0.00248996
,
0.00261044
,
0.00289157
,
0.00293173
,
0.00305221
,
0.00313253
,
0.00317269
,
0.00321285
,
0.00325301
,
0.00333333
,
0.00345382
,
0.00369478
,
0.00373494
,
0.0037751
,
0.00389558
,
0.00405622
,
0.00413655
,
0.00425703
,
0.00429719
,
0.00433735
,
0.00437751
,
0.00441767
,
0.00449799
,
0.00453815
,
0.00465863
,
0.0046988
,
0.00473896
,
0.00481928
,
0.00485944
,
0.0048996
,
0.00518072
,
0.00522088
,
0.0053012
,
0.00554217
,
0.00570281
,
0.00574297
,
0.00586345
,
0.00626506
,
0.00630522
,
0.00634538
,
0.00646586
,
0.00658635
,
0.00662651
,
0.00670683
,
0.00674699
,
0.00694779
,
0.00698795
,
0.00702811
,
0.00706827
,
0.00710843
,
0.00714859
,
0.00718876
,
0.00726908
,
0.00730924
,
0.00742972
,
0.0075502
,
0.00763052
,
0.00771084
,
0.00779116
,
0.00791165
,
0.00799197
,
0.00807229
,
0.00811245
,
0.00815261
,
0.00819277
,
0.00823293
,
0.00827309
,
0.00839357
,
0.00843373
,
0.00883534
,
0.00891566
,
0.00903614
,
0.00923695
,
0.00927711
,
0.00935743
,
0.00963855
,
0.00975904
,
0.00983936
,
0.01
])
subset_sample_values
=
np
.
array
([
1.76932
,
1.83651
,
1.78761
,
1.6316
,
0.721928
,
-
0.664077
,
-
0.249706
,
0.0236569
,
0.00668195
,
-
0.379618
,
-
0.575975
,
-
0.771114
,
-
0.951487
,
-
0.73516
,
0.742071
,
1.91577
,
1.96681
,
1.70642
,
1.02857
,
-
0.341839
,
-
1.42199
,
-
0.930797
,
-
0.0755387
,
0.122481
,
-
0.00631234
,
-
0.212412
,
-
0.0591181
,
0.112454
,
0.333336
,
0.584794
,
1.08309
,
1.44291
,
-
0.249515
,
-
0.701696
,
-
1.12623
,
-
1.94442
,
-
1.45207
,
-
0.663067
,
0.591886
,
0.910992
,
1.14409
,
1.28044
,
1.31795
,
1.12989
,
0.938508
,
0.261091
,
0.0805585
,
-
0.0466774
,
-
0.112311
,
-
0.0551393
,
0.0472029
,
0.354329
,
0.158647
,
-
0.400459
,
-
1.71079
,
-
0.771708
,
-
0.33113
,
1.04895
,
0.291854
,
-
0.0840174
,
-
0.414358
,
-
0.954231
,
-
0.770496
,
-
0.606599
,
-
0.259632
,
-
0.121617
,
-
0.247029
,
-
0.408011
,
-
0.575983
,
-
0.727348
,
-
0.838913
,
-
0.890317
,
-
0.866221
,
-
0.565119
,
-
0.295029
,
0.791266
,
1.71807
,
1.89685
,
1.60779
,
0.907671
,
-
0.488655
,
-
1.28001
,
-
1.71149
,
-
1.75931
,
-
1.69539
,
-
1.53092
,
-
1.28466
,
-
0.981105
,
-
0.00689592
,
0.25156
,
-
0.0715908
,
-
0.00857246
,
0.498828
,
1.24743
,
1.18842
,
0.783761
,
-
1.79994
,
-
1.9006
,
-
1.38735
,
0.348445
])
subset_sample_values
=
np
.
array
([
1.76932
,
1.83651
,
1.78761
,
1.6316
,
0.721928
,
-
0.664077
,
-
0.249706
,
0.0236569
,
0.00668195
,
-
0.379618
,
-
0.575975
,
-
0.771114
,
-
0.951487
,
-
0.73516
,
0.742071
,
1.91577
,
1.96681
,
1.70642
,
1.02857
,
-
0.341839
,
-
1.42199
,
-
0.930797
,
-
0.0755387
,
0.122481
,
-
0.00631234
,
-
0.212412
,
-
0.0591181
,
0.112454
,
0.333336
,
0.584794
,
1.08309
,
1.44291
,
-
0.249515
,
-
0.701696
,
-
1.12623
,
-
1.94442
,
-
1.45207
,
-
0.663067
,
0.591886
,
0.910992
,
1.14409
,
1.28044
,
1.31795
,
1.12989
,
0.938508
,
0.261091
,
0.0805585
,
-
0.0466774
,
-
0.112311
,
-
0.0551393
,
0.0472029
,
0.354329
,
0.158647
,
-
0.400459
,
-
1.71079
,
-
0.771708
,
-
0.33113
,
1.04895
,
0.291854
,
-
0.0840174
,
-
0.414358
,
-
0.954231
,
-
0.770496
,
-
0.606599
,
-
0.259632
,
-
0.121617
,
-
0.247029
,
-
0.408011
,
-
0.575983
,
-
0.727348
,
-
0.838913
,
-
0.890317
,
-
0.866221
,
-
0.565119
,
-
0.295029
,
0.791266
,
1.71807
,
1.89685
,
1.60779
,
0.907671
,
-
0.488655
,
-
1.28001
,
-
1.71149
,
-
1.75931
,
-
1.69539
,
-
1.53092
,
-
1.28466
,
-
0.981105
,
-
0.00689592
,
0.25156
,
-
0.0715908
,
-
0.00857246
,
0.498828
,
1.24743
,
1.18842
,
0.783761
,
-
1.79994
,
-
1.9006
,
-
1.38735
,
0.348445
])
dct_e
=
np
.
array
([
-
0.181725
,
1.31755
,
0.649338
,
0.146722
,
0.577319
,
0.52855
,
-
0.420861
,
0.00972246
,
1.34705
,
2.02479
,
-
0.45287
,
1.50728
,
0.11511
,
2.50369
,
-
0.860719
,
-
1.9832
,
-
0.188749
,
-
1.89087
,
0.895381
,
-
0.31801
,
-
1.49248
,
1.61864
,
-
0.740006
,
1.70221
,
1.18965
,
-
3.83239
,
-
0.595318
,
-
1.56708
,
-
0.0476166
,
-
0.958164
,
0.308146
,
0.538959
,
-
0.567305
,
-
1.54234
,
-
0.312223
,
-
1.05125
,
0.279093
,
-
0.555883
,
0.263304
,
-
1.87512
,
-
0.893629
,
1.52954
,
-
0.18754
,
0.129317
,
-
0.0409772
,
-
0.481374
,
-
0.272716
,
-
0.40792
,
-
0.428772
,
-
1.23366
,
0.932427
,
-
0.284411
,
0.114686
,
-
0.175491
,
0.287177
,
0.321669
,
-
0.324072
,
0.163224
,
0.792369
,
-
1.01108
,
1.23269
,
0.226345
,
0.882266
,
-
0.0194645
,
0.858726
,
0.459991
,
-
0.664407
,
-
0.433639
,
0.909784
,
0.119792
,
0.347188
,
0.0949223
,
-
0.223123
,
0.515855
,
1.06883
,
0.507396
,
1.05056
,
-
0.0203115
,
1.16572
,
0.471133
,
0.787901
,
-
0.74391
,
-
0.192763
,
0.246201
,
0.433876
,
0.56428
,
0.922964
,
0.921105
,
0.782957
,
1.06646
,
-
0.642362
,
-
0.560816
,
-
0.619862
,
0.406475
,
-
0.944654
,
0.524438
,
0.105425
,
0.192224
,
-
0.588941
,
0.361894
,
-
0.0422242
,
-
0.039336
,
-
0.739689
,
-
0.431406
,
-
0.503528
,
-
0.476026
,
0.321553
,
-
1.01571
,
-
0.572337
,
0.309822
,
0.917963
,
0.861005
,
-
0.763123
,
-
0.260667
,
0.35751
,
0.803767
,
-
0.39887
,
-
0.580729
,
-
0.517367
,
-
0.134686
,
-
0.22344
,
-
0.263698
,
-
0.449559
,
-
0.882012
,
-
0.477269
,
0.705133
,
0.471159
,
-
1.19926
,
-
0.238682
,
-
0.554693
,
0.795113
,
0.0240765
,
0.412576
,
-
0.0746031
,
-
0.56287
,
0.0267437
,
0.132269
,
-
0.577963
,
0.144747
,
-
0.0134209
,
-
0.0511658
,
1.41067
,
-
0.414959
,
-
0.290205
,
0.312317
,
-
0.102443
,
-
0.115503
,
-
0.133131
,
-
2.58108
,
-
0.421964
,
0.238911
,
0.822077
,
-
1.31384
,
-
0.674516
,
0.270687
,
-
0.216738
,
0.0403316
,
0.394182
,
-
1.24846
,
0.518855
,
-
1.11974
,
-
0.114353
,
-
0.105765
,
-
0.0767365
,
-
0.242629
,
0.767938
,
-
0.770488
,
1.15386
,
1.03914
,
-
0.08044
,
-
1.16603
,
1.0451
,
0.494025
,
-
0.362372
,
0.0147945
,
-
0.1952
,
-
0.333689
,
-
0.507866
,
1.61599
,
-
0.814214
,
0.0306287
,
-
0.659977
,
0.803305
,
0.150613
,
1.02249
,
0.340859
,
1.74513
,
0.55267
,
-
0.036223
,
0.240978
,
0.132654
,
0.227788
,
0.0112584
,
-
0.76642
,
0.941365
,
-
0.123865
,
0.579842
,
1.11127
,
-
0.478658
,
0.21837
,
-
0.213266
,
-
0.430659
,
0.953601
,
0.404303
,
0.593639
,
0.421635
,
-
0.771913
,
-
0.592505
,
-
0.627325
,
0.184693
,
0.317796
,
-
0.286112
,
-
0.478074
,
0.300756
,
0.0458375
,
0.821987
,
-
0.0354288
,
0.459321
,
0.595002
,
0.190285
,
0.373979
,
0.365756
,
-
0.575853
,
-
0.492914
,
-
0.671376
,
-
0.0743422
,
0.626893
,
0.863512
,
-
0.00458193
,
1.51513
,
0.183877
,
0.718056
,
-
0.512423
,
-
0.529361
,
0.0781563
,
0.336743
,
0.653948
,
0.683846
,
-
0.797976
,
1.4012
,
0.294974
,
-
0.716314
,
-
0.451483
,
0.0356109
,
1.05136
,
-
1.26643
,
0.0326029
,
0.0339741
,
-
0.294437
,
0.511468
])
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
# Part (a)
# Part (a)
...
@@ -28,3 +29,8 @@ if __name__ == "__main__":
...
@@ -28,3 +29,8 @@ if __name__ == "__main__":
plt
.
plot
(
subset_sample_times
,
subset_sample_values
)
plt
.
plot
(
subset_sample_times
,
subset_sample_values
)
plt
.
savefig
(
"
fig_d.png
"
)
plt
.
savefig
(
"
fig_d.png
"
)
plt
.
close
()
plt
.
close
()
# Part (e)
plt
.
plot
(
np
.
arange
(
len
(
dct
)),
dct_e
)
plt
.
savefig
(
"
fig_e.png
"
)
plt
.
close
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment