Multiple RSSI sub-plots using gonum/plot

Show me the code:)

const rows, cols = 2, 1
			plots := make([][]*plot.Plot, rows)
			for j := 0; j < rows; j++ {
				plots[j] = make([]*plot.Plot, cols)
				for i := 0; i < cols; i++ {
					pl := plot.New()
					pl.Add(plotter.NewGrid())
					pl.Title.Text = fmt.Sprintf("RSSI (%v-%v)", ant, symb)
					pl.Y.Label.Text = "RSSI(dBm)"
					pl.Y.Min = -130
					pl.Y.Max = -60
					pl.Legend.Top = true

					if i == 0 && j == 0 {
						pl.X.Label.Text = "FFT Bin"
						pl.X.Min = 0
						pl.X.Max = float64(len(m2.([]float64)) - 1)
						plotutil.AddLines(pl, "RSSI_per_RE", pts)
					}

					if i == 0 && j == 1 {
						pl.X.Label.Text = "PRB"
						pl.X.Min = 0
						pl.X.Max = float64(nbrPrb - 1)
						plotutil.AddLines(pl, "RSSI_per_PRB", pts2)
					}

					plots[j][i] = pl
				}
			}

			img := vgimg.New(8*vg.Inch, 8*vg.Inch)
			dc := draw.New(img)
			t := draw.Tiles{
				Rows:      rows,
				Cols:      cols,
				PadX:      vg.Millimeter,
				PadY:      vg.Millimeter,
				PadTop:    vg.Points(2),
				PadBottom: vg.Points(2),
				PadLeft:   vg.Points(2),
				PadRight:  vg.Points(2),
			}
			canvases := plot.Align(plots, t, dc)
			for j := 0; j < rows; j++ {
				for i := 0; i < cols; i++ {
					if plots[j][i] != nil {
						plots[j][i].Draw(canvases[j][i])
					}
				}
			}

			w, err := os.Create(path.Join(outPath, fmt.Sprintf("rssi_%v_%v.png", ant, symb)))
			if err != nil {
				p.writeLog(zapcore.ErrorLevel, err.Error())
			}
			defer w.Close()

			png := vgimg.PngCanvas{Canvas: img}
			if _, err := png.WriteTo(w); err != nil {
				p.writeLog(zapcore.ErrorLevel, err.Error())
			}

Per RE RSSI and Per PRB  RSSI will be shown in the same plot.

We can generally come to a conclusion that there is 8M DS interference to PRB 80~123.

Note: Estimating power from I/Q samples can be tricky somehow.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值