ssa
1package pmtm_test2
3import (4"fmt"5"strconv"6"testing"7
8"github.com/RB-PRO/ssa/pkg/oss"9"github.com/RB-PRO/ssa/pkg/pmtm"10"github.com/xuri/excelize/v2"11)
12
13func TestPmtm(t *testing.T) {14x, _ := oss.Make_singnal_xn("pmtm")15y := pmtm.Pmtm(x, 1024)16
17safeToXlsx(x, y)18}
19
20// Сохранить в xlsx для дебага
21func safeToXlsx(x, y []float64) {22
23file_graph := excelize.NewFile()24file_graph.NewSheet("main")25file_graph.DeleteSheet("Sheet1")26lenFor := len(x)27for ind := 0; ind < lenFor; ind++ {28file_graph.SetCellValue("golang", "A"+strconv.Itoa(ind+1), x[ind])29}30lenFor = len(y)31for ind := 0; ind < lenFor; ind++ {32file_graph.SetCellValue("golang", "B"+strconv.Itoa(ind+1), y[ind])33}34if err := file_graph.SaveAs("save_pmtm" + ".xlsx"); err != nil {35fmt.Println(err)36}37}
38