File: 0015-QT-GUI-Sink-Added-new-Matrix-Sink.patch

package info (click to toggle)
gnuradio 3.10.12.0-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 41,196 kB
  • sloc: cpp: 191,540; python: 91,856; ansic: 2,292; xml: 999; fortran: 927; sh: 477; makefile: 50
file content (1395 lines) | stat: -rw-r--r-- 43,158 bytes parent folder | download | duplicates (2)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
From b7f725ff6c579c86b20524cba74a2d07ad35927e Mon Sep 17 00:00:00 2001
From: Rohit Bisht <rbtunes0@gmail.com>
Date: Sun, 11 Jun 2023 00:19:53 +0000
Subject: [PATCH 15/41] QT GUI Sink : Added new Matrix Sink

Signed-off-by: Rohit Bisht <rbtunes0@gmail.com>
---
 .../examples/qt_gui_matrix_sink_example.grc   | 143 ++++++++
 gr-qtgui/grc/qtgui.tree.yml                   |   2 +-
 gr-qtgui/grc/qtgui_matrix_sink.block.yml      | 126 +++++++
 .../include/gnuradio/qtgui/CMakeLists.txt     |   1 +
 gr-qtgui/include/gnuradio/qtgui/matrix_sink.h |  87 +++++
 gr-qtgui/lib/CMakeLists.txt                   |  14 +-
 gr-qtgui/lib/matrix_display.cc                | 336 ++++++++++++++++++
 gr-qtgui/lib/matrix_display.h                 | 118 ++++++
 gr-qtgui/lib/matrix_display_signal.h          |  28 ++
 gr-qtgui/lib/matrix_sink_impl.cc              | 128 +++++++
 gr-qtgui/lib/matrix_sink_impl.h               |  67 ++++
 gr-qtgui/python/qtgui/bindings/CMakeLists.txt |   1 +
 .../docstrings/matrix_sink_pydoc_template.h   |  54 +++
 .../qtgui/bindings/matrix_sink_python.cc      | 101 ++++++
 .../python/qtgui/bindings/python_bindings.cc  |   2 +
 gr-qtgui/python/qtgui/qa_qtgui.py             |   4 +
 16 files changed, 1210 insertions(+), 2 deletions(-)
 create mode 100644 gr-qtgui/examples/qt_gui_matrix_sink_example.grc
 create mode 100644 gr-qtgui/grc/qtgui_matrix_sink.block.yml
 create mode 100644 gr-qtgui/include/gnuradio/qtgui/matrix_sink.h
 create mode 100644 gr-qtgui/lib/matrix_display.cc
 create mode 100644 gr-qtgui/lib/matrix_display.h
 create mode 100644 gr-qtgui/lib/matrix_display_signal.h
 create mode 100644 gr-qtgui/lib/matrix_sink_impl.cc
 create mode 100644 gr-qtgui/lib/matrix_sink_impl.h
 create mode 100644 gr-qtgui/python/qtgui/bindings/docstrings/matrix_sink_pydoc_template.h
 create mode 100644 gr-qtgui/python/qtgui/bindings/matrix_sink_python.cc

diff --git a/gr-qtgui/examples/qt_gui_matrix_sink_example.grc b/gr-qtgui/examples/qt_gui_matrix_sink_example.grc
new file mode 100644
index 0000000000..63d29e28e1
--- /dev/null
+++ b/gr-qtgui/examples/qt_gui_matrix_sink_example.grc
@@ -0,0 +1,143 @@
+options:
+  parameters:
+    author: ''
+    catch_exceptions: 'True'
+    category: '[GRC Hier Blocks]'
+    cmake_opt: ''
+    comment: ''
+    copyright: ''
+    description: ''
+    gen_cmake: 'On'
+    gen_linking: dynamic
+    generate_options: qt_gui
+    hier_block_src_path: '.:'
+    id: qt_gui_matrix_sink
+    max_nouts: '0'
+    output_language: python
+    placement: (0,0)
+    qt_qss_theme: ''
+    realtime_scheduling: ''
+    run: 'True'
+    run_command: '{python} -u {filename}'
+    run_options: prompt
+    sizing_mode: fixed
+    thread_safe_setters: ''
+    title: Not titled yet
+    window_size: (1000,1000)
+  states:
+    bus_sink: false
+    bus_source: false
+    bus_structure: null
+    coordinate: [8, 8]
+    rotation: 0
+    state: enabled
+
+blocks:
+- name: samp_rate
+  id: variable
+  parameters:
+    comment: ''
+    value: '32000'
+  states:
+    bus_sink: false
+    bus_source: false
+    bus_structure: null
+    coordinate: [184, 12]
+    rotation: 0
+    state: enabled
+- name: analog_noise_source_x_0
+  id: analog_noise_source_x
+  parameters:
+    affinity: ''
+    alias: ''
+    amp: '1'
+    comment: ''
+    maxoutbuf: '0'
+    minoutbuf: '0'
+    noise_type: analog.GR_GAUSSIAN
+    seed: '0'
+    type: float
+  states:
+    bus_sink: false
+    bus_source: false
+    bus_structure: null
+    coordinate: [64, 244.0]
+    rotation: 0
+    state: true
+- name: blocks_stream_to_vector_0
+  id: blocks_stream_to_vector
+  parameters:
+    affinity: ''
+    alias: ''
+    comment: ''
+    maxoutbuf: '0'
+    minoutbuf: '0'
+    num_items: '100'
+    type: float
+    vlen: '1'
+  states:
+    bus_sink: false
+    bus_source: false
+    bus_structure: null
+    coordinate: [280, 280.0]
+    rotation: 0
+    state: true
+- name: blocks_throttle2_0
+  id: blocks_throttle2
+  parameters:
+    affinity: ''
+    alias: ''
+    comment: ''
+    ignoretag: 'True'
+    limit: auto
+    maximum: '0.1'
+    maxoutbuf: '0'
+    minoutbuf: '0'
+    samples_per_second: samp_rate
+    type: float
+    vlen: '100'
+  states:
+    bus_sink: false
+    bus_source: false
+    bus_structure: null
+    coordinate: [448, 256.0]
+    rotation: 0
+    state: true
+- name: qtgui_matrix_sink_0
+  id: qtgui_matrix_sink
+  parameters:
+    affinity: ''
+    alias: ''
+    color_map: '"rgb"'
+    comment: ''
+    contour: 'False'
+    gui_hint: ''
+    interpolation: '"BilinearInterpolation"'
+    name: '"Matrix Sink"'
+    num_cols: '10'
+    vlen: '100'
+    x_axis_label: '"x-Axis"'
+    x_end: '1'
+    x_start: '0'
+    y_axis_label: '"y-Axis"'
+    y_end: '1'
+    y_start: '0'
+    z_axis_label: '"z-Axis"'
+    z_max: '1'
+    z_min: '0'
+  states:
+    bus_sink: false
+    bus_source: false
+    bus_structure: null
+    coordinate: [632, 152.0]
+    rotation: 0
+    state: enabled
+
+connections:
+- [analog_noise_source_x_0, '0', blocks_stream_to_vector_0, '0']
+- [blocks_stream_to_vector_0, '0', blocks_throttle2_0, '0']
+- [blocks_throttle2_0, '0', qtgui_matrix_sink_0, '0']
+
+metadata:
+  file_format: 1
+  grc_version: g8562b5cba
diff --git a/gr-qtgui/grc/qtgui.tree.yml b/gr-qtgui/grc/qtgui.tree.yml
index d860963737..d25e73641e 100644
--- a/gr-qtgui/grc/qtgui.tree.yml
+++ b/gr-qtgui/grc/qtgui.tree.yml
@@ -12,6 +12,7 @@
     - qtgui_number_sink
     - qtgui_vector_sink_f
     - qtgui_sink_x
+    - qtgui_matrix_sink
 - GUI Widgets:
   - QT:
     - qtgui_tab_widget
@@ -38,4 +39,3 @@
     - variable_qtgui_msg_push_button
     - variable_qtgui_toggle_button_msg
     - variable_qtgui_toggle_switch
-    
\ No newline at end of file
diff --git a/gr-qtgui/grc/qtgui_matrix_sink.block.yml b/gr-qtgui/grc/qtgui_matrix_sink.block.yml
new file mode 100644
index 0000000000..272386f9e5
--- /dev/null
+++ b/gr-qtgui/grc/qtgui_matrix_sink.block.yml
@@ -0,0 +1,126 @@
+id: qtgui_matrix_sink
+label: QT GUI Matrix Sink
+
+templates:
+  imports: |-
+    import sip
+
+  make: |-
+    <%
+        win = 'self._%s_win'%id
+    %>\
+    qtgui.matrix_sink(
+            ${name},
+            ${num_cols},
+            ${vlen},
+            ${contour},
+            ${color_map},
+            ${interpolation},
+            None          
+        )
+    self.${id}.set_x_start(${x_start})
+    self.${id}.set_x_end(${x_end})
+    self.${id}.set_y_start(${y_start})
+    self.${id}.set_y_end(${y_end})
+    self.${id}.set_z_max(${z_max})
+    self.${id}.set_z_min(${z_min})
+    self.${id}.set_x_axis_label(${x_axis_label})
+    self.${id}.set_y_axis_label(${y_axis_label})
+    self.${id}.set_z_axis_label(${z_axis_label})
+    ${win} = sip.wrapinstance(self.${id}.qwidget(), Qt.QWidget)
+    ${gui_hint() % win}
+
+parameters:
+  - id: name
+    label: Name
+    dtype: string
+    default: '"Matrix Sink"'
+    hide: ${ ('none' if len(name) > 0 else 'part') }
+  - id: vlen
+    label: Vector Size
+    dtype: int
+    default: 100
+  - id: num_cols
+    label: Number of Columns
+    dtype: int
+    default: 10
+  - id: contour
+    label: Contour Plot
+    dtype: bool
+    default: false
+    options: [true, false]
+  - id: color_map
+    label: Color Map
+    dtype: enum
+    default: '"rgb"'
+    options: ['"rgb"', '"indexed"', '"alpha"']
+    option_labels: ["RGB", "Indexed", "Alpha"]
+  - id: interpolation
+    label: Interpolation
+    dtype: enum
+    default: '"BilinearInterpolation"'
+    options: ['"BilinearInterpolation"', '"NearestNeighbour"']
+    option_labels: ["Bilinear Interpolation", "Nearest Neighbour"]
+  - id: x_start
+    label: X-Axis Start Value
+    dtype: real
+    default: 0
+    hide: part
+  - id: x_end
+    label: X-Axis End Value
+    dtype: real
+    default: 1
+    hide: part
+  - id: y_start
+    label: Y-Axis Start Value
+    dtype: real
+    default: 0
+    hide: part
+  - id: y_end
+    label: Y-Axis End Value
+    dtype: real
+    default: 1
+    hide: part
+  - id: z_max
+    label: Z-Axis Maximum Value
+    dtype: real
+    default: 1
+    hide: part
+  - id: z_min
+    label: Z-Axis Minimum Value
+    dtype: real
+    default: 0
+    hide: part
+  - id: x_axis_label
+    label: X-Axis Label
+    dtype: string
+    default: '"x-Axis"'
+    hide: part
+  - id: y_axis_label
+    label: Y-Axis Label
+    dtype: string
+    default: '"y-Axis"'
+    hide: part
+  - id: z_axis_label
+    label: Z-Axis Label
+    dtype: string
+    default: '"z-Axis"'
+    hide: part
+  - id: gui_hint
+    label: GUI Hint
+    dtype: gui_hint
+    hide: part
+
+inputs:
+  - domain: stream
+    dtype: float
+    vlen: ${ vlen }
+    optional: false
+
+documentation: |-
+  The matrix sink displays a 2D matrix of data as a color plot. The data is displayed in a window with a color bar on the right side. The color bar shows the mapping of data values to colors. The color bar can be used to change the range of data values that are displayed. 
+  The color map can be one of the following: RGB, indexed, or alpha. 
+  The interpolation method can be one of the following: none, bilinear or nearest neighbor. The matrix sink can also display contour lines. 
+  The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional.
+
+file_format: 1
diff --git a/gr-qtgui/include/gnuradio/qtgui/CMakeLists.txt b/gr-qtgui/include/gnuradio/qtgui/CMakeLists.txt
index d71cb71045..c42af7ef00 100644
--- a/gr-qtgui/include/gnuradio/qtgui/CMakeLists.txt
+++ b/gr-qtgui/include/gnuradio/qtgui/CMakeLists.txt
@@ -36,6 +36,7 @@ install(
           freqdisplayform.h
           histogram_sink_f.h
           histogramdisplayform.h
+          matrix_sink.h
           number_sink.h
           numberdisplayform.h
           plot_raster.h
diff --git a/gr-qtgui/include/gnuradio/qtgui/matrix_sink.h b/gr-qtgui/include/gnuradio/qtgui/matrix_sink.h
new file mode 100644
index 0000000000..8c3f3acbcd
--- /dev/null
+++ b/gr-qtgui/include/gnuradio/qtgui/matrix_sink.h
@@ -0,0 +1,87 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2023 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#ifndef INCLUDED_QTGUI_MATRIX_SINK_H
+#define INCLUDED_QTGUI_MATRIX_SINK_H
+
+#include <gnuradio/qtgui/api.h>
+#include <gnuradio/sync_block.h>
+#include <qapplication.h>
+#include <QWidget>
+
+namespace gr {
+namespace qtgui {
+
+/*!
+ * \brief A graphical sink that displays a matrix.
+ * \ingroup qtgui
+ * \ingroup qtgui_blk
+ *
+ * \details
+ * This block displays a matrix as a 2D plot. The matrix is
+ * displayed as a contour plot, with the color of each contour
+ * determined by the value of the matrix at that point.
+ *
+ * The matrix is displayed as a 2D plot, with the x and y axes
+ * corresponding to the row and column indices of the matrix,
+ * respectively. The z axis corresponds to the value of the
+ * matrix at that point.
+ *
+ */
+class QTGUI_API matrix_sink : virtual public gr::sync_block
+{
+public:
+    // gr::qtgui::matrix_sink::sptr
+    typedef std::shared_ptr<matrix_sink> sptr;
+
+    /*!
+     * \brief Build a matrix sink block.
+     *
+     * \param name The name of the block.
+     * \param num_cols The number of columns in the matrix.
+     * \param vlen The vector length of the matrix.
+     * \param contour Whether or not to display the matrix as a contour plot.
+     * \param color_map The color map to use for the contour plot.
+     * \param interpolation The interpolation method to use for the contour plot.
+     * \param x_start The starting value of the x axis.
+     * \param x_end The ending value of the x axis.
+     * \param y_start The starting value of the y axis.
+     * \param y_end The ending value of the y axis.
+     * \param z_max The maximum value of the z axis.
+     * \param z_min The minimum value of the z axis.
+     * \param x_axis_label The label for the x axis.
+     * \param y_axis_label The label for the y axis.
+     * \param z_axis_label The label for the z axis.
+     * \param parent The parent QWidget.
+     */
+    static sptr make(const std::string& name,
+                     unsigned int num_cols,
+                     unsigned int vlen,
+                     bool contour,
+                     const std::string& color_map,
+                     const std::string& interpolation,
+                     QWidget* parent = nullptr);
+
+    virtual void exec_() = 0;
+    virtual QWidget* qwidget() = 0;
+    virtual void set_x_start(double x_start) = 0;
+    virtual void set_x_end(double x_end) = 0;
+    virtual void set_y_start(double y_start) = 0;
+    virtual void set_y_end(double y_end) = 0;
+    virtual void set_z_max(double z_max) = 0;
+    virtual void set_z_min(double z_min) = 0;
+    virtual void set_x_axis_label(const std::string& x_axis_label) = 0;
+    virtual void set_y_axis_label(const std::string& y_axis_label) = 0;
+    virtual void set_z_axis_label(const std::string& z_axis_label) = 0;
+};
+
+} // namespace qtgui
+} // namespace gr
+
+#endif /* INCLUDED_QTGUI_MATRIX_SINK_H */
diff --git a/gr-qtgui/lib/CMakeLists.txt b/gr-qtgui/lib/CMakeLists.txt
index 5d520997b6..c890998d09 100644
--- a/gr-qtgui/lib/CMakeLists.txt
+++ b/gr-qtgui/lib/CMakeLists.txt
@@ -59,6 +59,8 @@ set(QTGUI_SOURCES
     vectordisplayform.cc
     vector_sink_f_impl.cc
     edit_box_msg_impl.cc
+    matrix_display.cc
+    matrix_sink_impl.cc
 )
 
 set(QTGUI_LIBS
@@ -115,7 +117,17 @@ qt5_wrap_cpp(
     ${qtgui_mod_includedir}/ConstellationDisplayPlot.h
     ${qtgui_mod_includedir}/HistogramDisplayPlot.h
     ${qtgui_mod_includedir}/VectorDisplayPlot.h
-    edit_box_msg_impl.h)
+    edit_box_msg_impl.h
+    matrix_display.h
+    matrix_display_signal.h
+    )
+if(ENABLE_GR_QTGUI_OPENGL)
+    qt5_wrap_cpp(
+        qtgui_moc_sources
+        QFosphorSurface.h
+        QFosphorColorMapper.h
+        )
+endif()
 target_sources(gnuradio-qtgui PRIVATE ${qtgui_moc_sources})
 qt5_wrap_ui(qtgui_ui_hdrs spectrumdisplayform.ui)
 target_sources(gnuradio-qtgui PRIVATE ${qtgui_ui_hdrs})
diff --git a/gr-qtgui/lib/matrix_display.cc b/gr-qtgui/lib/matrix_display.cc
new file mode 100644
index 0000000000..922c284967
--- /dev/null
+++ b/gr-qtgui/lib/matrix_display.cc
@@ -0,0 +1,336 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2023 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#include "matrix_display.h"
+#include <QDebug>
+#include <vector>
+
+matrix_display::matrix_display(const std::string& name,
+                               unsigned int num_cols,
+                               unsigned int vlen,
+                               bool contour,
+                               const std::string& color_map,
+                               const std::string& interpolation,
+                               double x_start,
+                               double x_end,
+                               double y_start,
+                               double y_end,
+                               double z_max,
+                               double z_min,
+                               const std::string& x_axis_label,
+                               const std::string& y_axis_label,
+                               const std::string& z_axis_label,
+                               QWidget* parent)
+    : QWidget(parent),
+      d_spectrogram(new QwtPlotSpectrogram()),
+      d_plot(new QwtPlot(this)),
+      d_vlen(vlen),
+      d_num_cols(num_cols),
+      d_x_start(x_start),
+      d_x_end(x_end),
+      d_y_start(y_start),
+      d_y_end(y_end),
+      d_z_max(z_max),
+      d_z_min(z_min)
+{
+    set_color_map(color_map);
+
+    set_x_axis_label(x_axis_label);
+    set_y_axis_label(y_axis_label);
+    set_z_axis_label(z_axis_label);
+
+
+    d_spectrogram->setDisplayMode(QwtPlotSpectrogram::DisplayMode::ImageMode, true);
+    set_contour(contour);
+    d_spectrogram->setColorMap(d_colorMap);
+
+
+    d_data.setInterval(Qt::XAxis, QwtInterval(d_x_start, d_x_end));
+    d_data.setInterval(Qt::YAxis, QwtInterval(d_y_start, d_y_end));
+    d_data.setInterval(Qt::ZAxis, QwtInterval(d_z_min, d_z_max));
+    set_interpolation(interpolation);
+    d_spectrogram->attach(d_plot);
+    d_plot->repaint();
+    d_plot->show();
+
+    d_hLayout = new QHBoxLayout();
+    d_hLayout->addWidget(d_plot);
+    this->setLayout(d_hLayout);
+
+    initialize_mouse_actions();
+}
+matrix_display::~matrix_display()
+{
+    // Qt deletes children when parent is deleted
+    d_spectrogram->detach();
+    d_isclosed = true;
+}
+
+bool matrix_display::isClosed() const { return d_isclosed; }
+
+void matrix_display::closeEvent(QCloseEvent* e)
+{
+    d_isclosed = true;
+    qApp->processEvents();
+    QWidget::closeEvent(e);
+}
+
+void matrix_display::initialize_mouse_actions()
+{
+    d_menu_on = true;
+    d_menu = new QMenu(this);
+
+    d_stop_act = new QAction("Stop", this);
+    d_stop_act->setStatusTip(tr("Start/Stop"));
+    connect(d_stop_act, SIGNAL(triggered()), this, SLOT(set_stop()));
+
+    d_stop_state = false;
+    d_menu->addAction(d_stop_act);
+
+    d_save_act = new QAction("Save", this);
+    d_save_act->setStatusTip(tr("Save Figure"));
+    connect(d_save_act, SIGNAL(triggered()), this, SLOT(save_figure()));
+    d_menu->addAction(d_save_act);
+
+    d_contour_menu = new QMenu;
+    d_contour_menu->setTitle("Contour");
+    QAction* contour_on = new QAction("On", this);
+    connect(contour_on, &QAction::triggered, this, [this]() { contour(true); });
+    d_contour_menu->addAction(contour_on);
+    QAction* contour_off = new QAction("Off", this);
+    connect(contour_off, &QAction::triggered, this, [this]() { contour(false); });
+    d_contour_menu->addAction(contour_off);
+    d_menu->addMenu(d_contour_menu);
+
+    d_interpolation_menu = new QMenu;
+    d_interpolation_menu->setTitle("Interpolation");
+    QAction* bilinear = new QAction("Bilinear Interpolation", this);
+    connect(bilinear, &QAction::triggered, this, [this]() {
+        interpolation("BilinearInterpolation");
+    });
+    d_interpolation_menu->addAction(bilinear);
+    QAction* nearest = new QAction("Nearest Neighbour Interpolation", this);
+    connect(nearest, &QAction::triggered, this, [this]() {
+        interpolation("NearestNeighbour");
+    });
+    d_interpolation_menu->addAction(nearest);
+    d_menu->addMenu(d_interpolation_menu);
+}
+void matrix_display::set_contour(bool contour)
+{
+    if (contour) {
+        for (double level = 0.5; level < 10.0; level += 1.0)
+            d_contour_levels += level;
+        d_spectrogram->setContourLevels(d_contour_levels);
+        d_spectrogram->setDisplayMode(QwtPlotSpectrogram::DisplayMode::ContourMode, true);
+    } else
+        d_spectrogram->setDisplayMode(QwtPlotSpectrogram::DisplayMode::ImageMode, true);
+}
+
+void matrix_display::set_color_map(const std::string& color_map)
+{
+    if (color_map == "rgb") {
+        d_colorMap = new QwtLinearColorMap(Qt::darkCyan, Qt::red, QwtColorMap::RGB);
+        d_colorMap->addColorStop(0.1, Qt::cyan);
+        d_colorMap->addColorStop(0.6, Qt::green);
+        d_colorMap->addColorStop(0.95, Qt::yellow);
+
+        d_z_colorMap = new QwtLinearColorMap(Qt::darkCyan, Qt::red, QwtColorMap::RGB);
+        d_z_colorMap->addColorStop(0.1, Qt::cyan);
+        d_z_colorMap->addColorStop(0.6, Qt::green);
+        d_z_colorMap->addColorStop(0.95, Qt::yellow);
+
+    } else if (color_map == "indexed") {
+        d_colorMap = new QwtLinearColorMap(Qt::blue, Qt::red, QwtColorMap::Indexed);
+
+        d_z_colorMap = new QwtLinearColorMap(Qt::blue, Qt::red, QwtColorMap::Indexed);
+
+    } else if (color_map == "alpha") {
+        QwtAlphaColorMap* alpha_map = new QwtAlphaColorMap();
+        alpha_map->setColor(Qt::darkBlue);
+        d_colorMap = (QwtLinearColorMap*)alpha_map;
+        d_z_colorMap = (QwtLinearColorMap*)alpha_map;
+    }
+}
+
+void matrix_display::set_interpolation(const std::string& interpolation)
+{
+    //'BilinearInterpolation','NearestNeighbour'
+    if (interpolation == "BilinearInterpolation") {
+        d_data.setResampleMode(QwtMatrixRasterData::ResampleMode::BilinearInterpolation);
+    } else if (interpolation == "NearestNeighbour") {
+        d_data.setResampleMode(QwtMatrixRasterData::ResampleMode::NearestNeighbour);
+    }
+}
+
+void matrix_display::set_x_start(double x_start)
+{
+    d_x_start = x_start;
+    d_data.setInterval(Qt::XAxis, QwtInterval(d_x_start, d_x_end));
+}
+
+void matrix_display::set_x_end(double x_end)
+{
+    d_x_end = x_end;
+    d_data.setInterval(Qt::XAxis, QwtInterval(d_x_start, d_x_end));
+}
+
+void matrix_display::set_y_start(double y_start)
+{
+    d_y_start = y_start;
+    d_data.setInterval(Qt::YAxis, QwtInterval(d_y_start, d_y_end));
+}
+
+void matrix_display::set_y_end(double y_end)
+{
+    d_y_end = y_end;
+    d_data.setInterval(Qt::YAxis, QwtInterval(d_y_start, d_y_end));
+}
+
+void matrix_display::set_z_max(double z_start)
+{
+    d_z_max = z_start;
+    d_data.setInterval(Qt::ZAxis, QwtInterval(d_z_min, d_z_max));
+}
+
+void matrix_display::set_z_min(double z_end)
+{
+    d_z_min = z_end;
+    d_data.setInterval(Qt::ZAxis, QwtInterval(d_z_min, d_z_max));
+}
+
+void matrix_display::set_x_axis_label(const std::string& x_axis_label)
+{
+    d_x_axis = d_plot->axisWidget(QwtPlot::xBottom);
+    d_x_axis->setTitle(x_axis_label.c_str());
+    d_plot->enableAxis(QwtPlot::xBottom, true);
+}
+
+void matrix_display::set_y_axis_label(const std::string& y_axis_label)
+{
+    d_y_axis = d_plot->axisWidget(QwtPlot::yLeft);
+    d_y_axis->setTitle(y_axis_label.c_str());
+    d_plot->enableAxis(QwtPlot::yLeft, true);
+}
+
+void matrix_display::set_z_axis_label(const std::string& z_axis_label)
+{
+    d_z_axis = d_plot->axisWidget(QwtPlot::yRight);
+    d_z_axis->setTitle(z_axis_label.c_str());
+    d_z_axis->setColorBarEnabled(true);
+    d_z_axis->setColorMap(QwtInterval(d_z_min, d_z_max), d_z_colorMap);
+    d_plot->setAxisScale(QwtPlot::yRight, d_z_min, d_z_max);
+    d_plot->enableAxis(QwtPlot::yRight, true);
+}
+
+
+void matrix_display::save_figure()
+{
+    QPixmap qpix = this->grab();
+
+    QString types = QString(tr("Portable Network Graphics file (*.png);;JPEG file "
+                               "(*.jpg);;Bitmap file (*.bmp);;TIFF file (*.tiff)"));
+
+    QString filename, filetype;
+    QFileDialog* filebox = new QFileDialog(0, "Save Image", "./", types);
+    filebox->setViewMode(QFileDialog::Detail);
+    filebox->setAcceptMode(QFileDialog::AcceptSave);
+    filebox->setFileMode(QFileDialog::AnyFile);
+    if (filebox->exec()) {
+        filename = filebox->selectedFiles()[0];
+        filetype = filebox->selectedNameFilter();
+    } else {
+        return;
+    }
+
+    if (filetype.contains(".jpg")) {
+        qpix.save(filename + ".jpg", "JPEG");
+    } else if (filetype.contains(".png")) {
+        qpix.save(filename + ".png", "PNG");
+    } else if (filetype.contains(".bmp")) {
+        qpix.save(filename + ".bmp", "BMP");
+    } else if (filetype.contains(".tiff")) {
+        qpix.save(filename + ".tiff", "TIFF");
+    } else {
+        qpix.save(filename + ".jpg", "JPEG");
+    }
+
+    delete filebox;
+}
+
+void matrix_display::mousePressEvent(QMouseEvent* e)
+{
+
+    bool ctrloff = Qt::ControlModifier != QApplication::keyboardModifiers();
+    if ((e->button() == Qt::MiddleButton) && ctrloff && (d_menu_on)) {
+        if (d_stop_state == false)
+            d_stop_act->setText(tr("Stop"));
+        else
+            d_stop_act->setText(tr("Start"));
+
+        d_menu->exec(e->globalPos());
+    }
+}
+
+void matrix_display::set_stop(bool on)
+{
+    if (!on) {
+        d_stop_state = false;
+    } else {
+        d_stop_state = true;
+    }
+}
+
+void matrix_display::set_stop()
+{
+    if (d_stop_state == false)
+        set_stop(true);
+    else
+        set_stop(false);
+}
+
+void matrix_display::contour(bool contour)
+{
+    if (contour) {
+        for (double level = 0.5; level < 10.0; level += 1.0)
+            d_contour_levels += level;
+        d_spectrogram->setContourLevels(d_contour_levels);
+        d_spectrogram->setDisplayMode(QwtPlotSpectrogram::DisplayMode::ContourMode, true);
+    } else {
+        d_spectrogram->setDisplayMode(QwtPlotSpectrogram::DisplayMode::ContourMode,
+                                      false);
+        d_spectrogram->setDisplayMode(QwtPlotSpectrogram::DisplayMode::ImageMode, true);
+    }
+
+    d_plot->replot();
+}
+
+
+void matrix_display::interpolation(const std::string& interpolation)
+{
+    //'BilinearInterpolation','NearestNeighbour'
+    if (interpolation == "BilinearInterpolation") {
+        d_data.setResampleMode(QwtMatrixRasterData::ResampleMode::BilinearInterpolation);
+    } else if (interpolation == "NearestNeighbour") {
+        d_data.setResampleMode(QwtMatrixRasterData::ResampleMode::NearestNeighbour);
+    }
+
+    d_plot->replot();
+}
+
+void matrix_display::set_data(QVector<double> data)
+{
+
+    if (!d_stop_state) {
+        d_data.setValueMatrix(data, d_num_cols);
+
+        d_spectrogram->setData(&d_data);
+        d_plot->replot();
+    }
+}
diff --git a/gr-qtgui/lib/matrix_display.h b/gr-qtgui/lib/matrix_display.h
new file mode 100644
index 0000000000..806833d57b
--- /dev/null
+++ b/gr-qtgui/lib/matrix_display.h
@@ -0,0 +1,118 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2023 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#ifndef MATRIX_DISPLAY_H
+#define MATRIX_DISPLAY_H
+
+#include <gnuradio/qtgui/form_menus.h>
+#include <QtWidgets/QHBoxLayout>
+#include <QtWidgets/QLabel>
+#include <QtWidgets/QScrollArea>
+#include <QtWidgets/QSpacerItem>
+#include <QtWidgets/QVBoxLayout>
+#include <QtWidgets/QWidget>
+#include <qwt_color_map.h>
+#include <qwt_interval.h>
+#include <qwt_matrix_raster_data.h>
+#include <qwt_plot.h>
+#include <qwt_plot_spectrogram.h>
+#include <qwt_scale_widget.h>
+#include <QAction>
+#include <QApplication>
+#include <QFileDialog>
+#include <QMenu>
+#include <QMouseEvent>
+#include <QPixmap>
+#include <QVector>
+#include <vector>
+
+/*!
+ * \brief Matrix Display child for managing sink plot.
+ * \ingroup qtgui_blk
+ */
+class matrix_display : public QWidget
+{
+    Q_OBJECT
+
+    QwtPlotSpectrogram* d_spectrogram;
+    QwtPlot* d_plot;
+    QwtLinearColorMap* d_colorMap;
+    QwtMatrixRasterData d_data;
+    QwtScaleWidget* d_x_axis;
+    QwtScaleWidget* d_y_axis;
+    QwtScaleWidget* d_z_axis;
+    QwtLinearColorMap* d_z_colorMap;
+
+    QHBoxLayout* d_hLayout;
+
+
+    unsigned int d_vlen;
+    unsigned int d_num_cols;
+    double d_x_start;
+    double d_x_end;
+    double d_y_start;
+    double d_y_end;
+    double d_z_max;
+    double d_z_min;
+    QList<double> d_contour_levels;
+    QMenu* d_menu = nullptr;
+    QAction* d_save_act = nullptr;
+    bool d_menu_on;
+    bool d_stop_state;
+    QAction* d_stop_act = nullptr;
+    QMenu* d_contour_menu = nullptr;
+    QMenu* d_interpolation_menu = nullptr;
+    QMenu* d_color_map_menu = nullptr;
+    bool d_isclosed = false;
+
+public:
+    explicit matrix_display(const std::string& name,
+                            unsigned int num_cols,
+                            unsigned int vlen,
+                            bool contour,
+                            const std::string& color_map,
+                            const std::string& interpolation,
+                            double x_start,
+                            double x_end,
+                            double y_start,
+                            double y_end,
+                            double z_max,
+                            double z_min,
+                            const std::string& x_axis_label,
+                            const std::string& y_axis_label,
+                            const std::string& z_axis_label,
+                            QWidget* parent = nullptr);
+    ~matrix_display();
+
+    void set_contour(bool contour);
+    void set_color_map(const std::string& color_map);
+    void set_interpolation(const std::string& interpolation);
+    void set_x_start(double x_start);
+    void set_x_end(double x_end);
+    void set_y_start(double y_start);
+    void set_y_end(double y_end);
+    void set_z_max(double z_max);
+    void set_z_min(double z_min);
+    void set_x_axis_label(const std::string& x_axis_label);
+    void set_y_axis_label(const std::string& y_axis_label);
+    void set_z_axis_label(const std::string& z_axis_label);
+    void initialize_mouse_actions();
+    bool isClosed() const;
+
+public slots:
+    void set_data(QVector<double> data);
+    void save_figure();
+    void mousePressEvent(QMouseEvent* e) override;
+    void set_stop(bool on);
+    void set_stop();
+    void contour(bool contour);
+    void interpolation(const std::string& interpolation);
+    void closeEvent(QCloseEvent* e) override;
+};
+#endif // MATRIX_DISPLAY_H
diff --git a/gr-qtgui/lib/matrix_display_signal.h b/gr-qtgui/lib/matrix_display_signal.h
new file mode 100644
index 0000000000..aed42881d4
--- /dev/null
+++ b/gr-qtgui/lib/matrix_display_signal.h
@@ -0,0 +1,28 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2023 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#ifndef MATRIX_DISPLAY_SIGNAL_H
+#define MATRIX_DISPLAY_SIGNAL_H
+
+#include <QObject>
+#include <QVector>
+
+class matrix_display_signal : public QObject
+{
+    Q_OBJECT
+
+public:
+    matrix_display_signal() {}
+    ~matrix_display_signal() {}
+
+signals:
+    void data_ready(QVector<double> data);
+};
+
+#endif /* MATRIX_DISPLAY_SIGNAL_H */
diff --git a/gr-qtgui/lib/matrix_sink_impl.cc b/gr-qtgui/lib/matrix_sink_impl.cc
new file mode 100644
index 0000000000..7ef474e230
--- /dev/null
+++ b/gr-qtgui/lib/matrix_sink_impl.cc
@@ -0,0 +1,128 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2023 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#include "matrix_sink_impl.h"
+#include <gnuradio/io_signature.h>
+#include <QVector>
+
+namespace gr {
+namespace qtgui {
+
+using input_type = float;
+matrix_sink::sptr matrix_sink::make(const std::string& name,
+                                    unsigned int num_cols,
+                                    unsigned int vlen,
+                                    bool contour,
+                                    const std::string& color_map,
+                                    const std::string& interpolation,
+                                    QWidget* parent)
+{
+    return gnuradio::make_block_sptr<matrix_sink_impl>(
+        name, num_cols, vlen, contour, color_map, interpolation, parent);
+}
+
+
+matrix_sink_impl::matrix_sink_impl(const std::string& name,
+                                   unsigned int num_cols,
+                                   unsigned int vlen,
+                                   bool contour,
+                                   const std::string& color_map,
+                                   const std::string& interpolation,
+                                   QWidget* parent)
+    : gr::sync_block("matrix_sink",
+                     gr::io_signature::make(1, 1, sizeof(input_type) * vlen),
+                     gr::io_signature::make(0, 0, 0)),
+      d_parent(parent),
+      d_vlen(vlen),
+      d_name(name),
+      d_display(new matrix_display(name,
+                                   num_cols,
+                                   vlen,
+                                   contour,
+                                   color_map,
+                                   interpolation,
+                                   0,
+                                   1,
+                                   0,
+                                   1,
+                                   0,
+                                   1,
+                                   "X",
+                                   "Y",
+                                   "Z",
+                                   d_parent)),
+      d_signal(new matrix_display_signal()),
+      d_qApplication(qApp ? qApp : new QApplication(d_argc, const_cast<char**>(&d_argv)))
+{
+    qRegisterMetaType<QVector<double>>("QVector<double>");
+    QObject::connect(d_signal,
+                     &matrix_display_signal::data_ready,
+                     d_display,
+                     &matrix_display::set_data);
+}
+
+/*
+ * Our virtual destructor.
+ */
+matrix_sink_impl::~matrix_sink_impl()
+{
+    if (!d_display->isClosed()) {
+        d_display->close();
+    }
+}
+
+void matrix_sink_impl::exec_() { d_qApplication->exec(); }
+
+QWidget* matrix_sink_impl::qwidget() { return (QWidget*)d_display; }
+
+void matrix_sink_impl::set_x_axis_label(const std::string& x_axis_label)
+{
+    d_display->set_x_axis_label(x_axis_label);
+}
+
+void matrix_sink_impl::set_y_axis_label(const std::string& y_axis_label)
+{
+    d_display->set_y_axis_label(y_axis_label);
+}
+
+void matrix_sink_impl::set_z_axis_label(const std::string& z_axis_label)
+{
+    d_display->set_z_axis_label(z_axis_label);
+}
+
+void matrix_sink_impl::set_x_start(double x_start) { d_display->set_x_start(x_start); }
+
+void matrix_sink_impl::set_x_end(double x_end) { d_display->set_x_end(x_end); }
+
+void matrix_sink_impl::set_y_start(double y_start) { d_display->set_y_start(y_start); }
+
+void matrix_sink_impl::set_y_end(double y_end) { d_display->set_y_end(y_end); }
+
+void matrix_sink_impl::set_z_max(double z_max) { d_display->set_z_max(z_max); }
+
+void matrix_sink_impl::set_z_min(double z_min) { d_display->set_z_min(z_min); }
+
+
+int matrix_sink_impl::work(int noutput_items,
+                           gr_vector_const_void_star& input_items,
+                           gr_vector_void_star& output_items)
+{
+    auto in = static_cast<const input_type*>(input_items[0]);
+
+    for (int k = 0; k < noutput_items; k++) {
+        std::vector<input_type> a(in + k * d_vlen, in + (k + 1) * d_vlen);
+        QVector<double> qvec(a.begin(), a.end());
+        emit d_signal->data_ready(qvec);
+    }
+
+    return noutput_items;
+}
+
+} /* namespace qtgui */
+} /* namespace gr */
diff --git a/gr-qtgui/lib/matrix_sink_impl.h b/gr-qtgui/lib/matrix_sink_impl.h
new file mode 100644
index 0000000000..75edcb835d
--- /dev/null
+++ b/gr-qtgui/lib/matrix_sink_impl.h
@@ -0,0 +1,67 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2023 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#ifndef INCLUDED_QTGUI_MATRIX_SINK_IMPL_H
+#define INCLUDED_QTGUI_MATRIX_SINK_IMPL_H
+
+#include "matrix_display.h"
+#include "matrix_display_signal.h"
+
+#include <gnuradio/qtgui/matrix_sink.h>
+#include <qapplication.h>
+#include <QObject>
+#include <vector>
+
+namespace gr {
+namespace qtgui {
+
+class QTGUI_API matrix_sink_impl : public matrix_sink
+{
+private:
+    QWidget* d_parent;
+    unsigned int d_vlen;
+    std::string d_name;
+    std::vector<double> d_data;
+    const char* d_argv = "";
+    int d_argc = 1;
+    matrix_display* d_display;
+    matrix_display_signal* d_signal = nullptr;
+
+public:
+    matrix_sink_impl(const std::string& name,
+                     unsigned int num_cols,
+                     unsigned int vlen,
+                     bool contour,
+                     const std::string& color_map,
+                     const std::string& interpolation,
+                     QWidget* parent = nullptr);
+    ~matrix_sink_impl();
+
+    void exec_() override;
+    QApplication* d_qApplication;
+    QWidget* qwidget() override;
+    void set_x_start(double x_start) override;
+    void set_x_end(double x_end) override;
+    void set_y_start(double y_start) override;
+    void set_y_end(double y_end) override;
+    void set_z_max(double z_max) override;
+    void set_z_min(double z_min) override;
+    void set_x_axis_label(const std::string& x_axis_label) override;
+    void set_y_axis_label(const std::string& y_axis_label) override;
+    void set_z_axis_label(const std::string& z_axis_label) override;
+    // Where all the action really happens
+    int work(int noutput_items,
+             gr_vector_const_void_star& input_items,
+             gr_vector_void_star& output_items) override;
+};
+
+} // namespace qtgui
+} // namespace gr
+
+#endif /* INCLUDED_QTGUI_MATRIX_SINK_IMPL_H */
diff --git a/gr-qtgui/python/qtgui/bindings/CMakeLists.txt b/gr-qtgui/python/qtgui/bindings/CMakeLists.txt
index 3ec70bac73..75dc6b3817 100644
--- a/gr-qtgui/python/qtgui/bindings/CMakeLists.txt
+++ b/gr-qtgui/python/qtgui/bindings/CMakeLists.txt
@@ -31,6 +31,7 @@ list(
     freqdisplayform_python.cc
     histogram_sink_f_python.cc
     histogramdisplayform_python.cc
+    matrix_sink_python.cc
     number_sink_python.cc
     numberdisplayform_python.cc
     # plot_raster_python.cc
diff --git a/gr-qtgui/python/qtgui/bindings/docstrings/matrix_sink_pydoc_template.h b/gr-qtgui/python/qtgui/bindings/docstrings/matrix_sink_pydoc_template.h
new file mode 100644
index 0000000000..03698a3dc7
--- /dev/null
+++ b/gr-qtgui/python/qtgui/bindings/docstrings/matrix_sink_pydoc_template.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2023 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *
+ */
+#include "pydoc_macros.h"
+#define D(...) DOC(gr, qtgui, __VA_ARGS__)
+/*
+  This file contains placeholders for docstrings for the Python bindings.
+  Do not edit! These were automatically extracted during the binding process
+  and will be overwritten during the build process
+ */
+
+
+static const char* __doc_gr_qtgui_matrix_sink = R"doc()doc";
+
+
+static const char* __doc_gr_qtgui_matrix_sink_make = R"doc()doc";
+
+
+static const char* __doc_gr_qtgui_matrix_sink_exec_ = R"doc()doc";
+
+
+static const char* __doc_gr_qtgui_matrix_sink_qwidget = R"doc()doc";
+
+
+static const char* __doc_gr_qtgui_matrix_sink_set_x_start = R"doc()doc";
+
+
+static const char* __doc_gr_qtgui_matrix_sink_set_x_end = R"doc()doc";
+
+
+static const char* __doc_gr_qtgui_matrix_sink_set_y_start = R"doc()doc";
+
+
+static const char* __doc_gr_qtgui_matrix_sink_set_y_end = R"doc()doc";
+
+
+static const char* __doc_gr_qtgui_matrix_sink_set_z_min = R"doc()doc";
+
+
+static const char* __doc_gr_qtgui_matrix_sink_set_z_max = R"doc()doc";
+
+
+static const char* __doc_gr_qtgui_matrix_sink_set_x_axis_label = R"doc()doc";
+
+
+static const char* __doc_gr_qtgui_matrix_sink_set_y_axis_label = R"doc()doc";
+
+
+static const char* __doc_gr_qtgui_matrix_sink_set_z_axis_label = R"doc()doc";
diff --git a/gr-qtgui/python/qtgui/bindings/matrix_sink_python.cc b/gr-qtgui/python/qtgui/bindings/matrix_sink_python.cc
new file mode 100644
index 0000000000..59a32c74fc
--- /dev/null
+++ b/gr-qtgui/python/qtgui/bindings/matrix_sink_python.cc
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2023 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *
+ */
+
+#include <pybind11/complex.h>
+#include <pybind11/pybind11.h>
+#include <pybind11/stl.h>
+
+namespace py = pybind11;
+
+#include <gnuradio/qtgui/matrix_sink.h>
+// pydoc.h is automatically generated in the build directory
+#include <matrix_sink_pydoc.h>
+
+void bind_matrix_sink(py::module& m)
+{
+
+    using matrix_sink = gr::qtgui::matrix_sink;
+
+
+    py::class_<matrix_sink, gr::block, gr::basic_block, std::shared_ptr<matrix_sink>>(
+        m, "matrix_sink", D(matrix_sink))
+
+        .def(py::init(&matrix_sink::make),
+             py::arg("name"),
+             py::arg("num_cols"),
+             py::arg("vlen"),
+             py::arg("contour"),
+             py::arg("color_map"),
+             py::arg("interpolation"),
+             py::arg("parent") = nullptr,
+             D(matrix_sink, make))
+
+
+        .def("exec_", &matrix_sink::exec_, D(matrix_sink, exec_))
+
+
+        .def(
+            "qwidget",
+            [](matrix_sink& self) { return reinterpret_cast<uintptr_t>(self.qwidget()); },
+            D(matrix_sink, qwidget))
+
+
+        .def("set_x_start",
+             &matrix_sink::set_x_start,
+             py::arg("x_start"),
+             D(matrix_sink, set_x_start))
+
+
+        .def("set_x_end",
+             &matrix_sink::set_x_end,
+             py::arg("x_end"),
+             D(matrix_sink, set_x_end))
+
+
+        .def("set_y_start",
+             &matrix_sink::set_y_start,
+             py::arg("y_start"),
+             D(matrix_sink, set_y_start))
+
+
+        .def("set_y_end",
+             &matrix_sink::set_y_end,
+             py::arg("y_end"),
+             D(matrix_sink, set_y_end))
+
+
+        .def("set_z_max",
+             &matrix_sink::set_z_max,
+             py::arg("z_max"),
+             D(matrix_sink, set_z_max))
+
+
+        .def("set_z_min",
+             &matrix_sink::set_z_min,
+             py::arg("z_min"),
+             D(matrix_sink, set_z_min))
+
+
+        .def("set_x_axis_label",
+             &matrix_sink::set_x_axis_label,
+             py::arg("x_axis_label"),
+             D(matrix_sink, set_x_axis_label))
+
+
+        .def("set_y_axis_label",
+             &matrix_sink::set_y_axis_label,
+             py::arg("y_axis_label"),
+             D(matrix_sink, set_y_axis_label))
+
+
+        .def("set_z_axis_label",
+             &matrix_sink::set_z_axis_label,
+             py::arg("z_axis_label"),
+             D(matrix_sink, set_z_axis_label));
+}
diff --git a/gr-qtgui/python/qtgui/bindings/python_bindings.cc b/gr-qtgui/python/qtgui/bindings/python_bindings.cc
index 3650a2be89..97bf1df59e 100644
--- a/gr-qtgui/python/qtgui/bindings/python_bindings.cc
+++ b/gr-qtgui/python/qtgui/bindings/python_bindings.cc
@@ -39,6 +39,7 @@ void bind_freqcontrolpanel(py::module&);
 void bind_freqdisplayform(py::module&);
 void bind_histogram_sink_f(py::module&);
 void bind_histogramdisplayform(py::module&);
+void bind_matrix_sink(py::module&);
 void bind_number_sink(py::module&);
 void bind_numberdisplayform(py::module&);
 // void bind_plot_raster(py::module&);
@@ -109,6 +110,7 @@ PYBIND11_MODULE(qtgui_python, m)
     // bind_freqdisplayform(m);
     bind_histogram_sink_f(m);
     // bind_histogramdisplayform(m);
+    bind_matrix_sink(m);
     bind_number_sink(m);
     // bind_numberdisplayform(m);
     // // bind_plot_raster(m);
diff --git a/gr-qtgui/python/qtgui/qa_qtgui.py b/gr-qtgui/python/qtgui/qa_qtgui.py
index 6acf9de547..7eb640a88d 100644
--- a/gr-qtgui/python/qtgui/qa_qtgui.py
+++ b/gr-qtgui/python/qtgui/qa_qtgui.py
@@ -78,6 +78,10 @@ class test_qtgui(gr_unittest.TestCase):
     def test14(self):
         self.qtsnk = qtgui.eye_sink_c(1024, 1, 1, None)
 
+    def test15(self):
+        self.qtsnk = qtgui.matrix_sink("Doppler", 2, 4, False,
+                                       "rgb", "BilinearInterpolation", None)
+
 
 if __name__ == '__main__':
     gr_unittest.run(test_qtgui)
-- 
2.47.3