feature/visual-ir (#3)

Co-authored-by: Bastian Bührig <bastian.buehrig@2bconsult.eu>
Reviewed-on: #3
This commit was merged in pull request #3.
This commit is contained in:
2025-07-11 14:39:01 +02:00
parent bb9a93a4f0
commit 80ab0f0922
7 changed files with 387 additions and 1 deletions

15
main.go
View File

@@ -6,6 +6,7 @@ import (
"os"
"valhallir-deconvolver/pkg/convolve"
"valhallir-deconvolver/pkg/plot"
"valhallir-deconvolver/pkg/wav"
"github.com/urfave/cli/v2"
@@ -78,6 +79,10 @@ func main() {
Usage: "Cut filter slope in dB/octave (12, 24, 36, 48, ...; default 12)",
Value: 12,
},
&cli.BoolFlag{
Name: "plot-ir",
Usage: "Plot the generated regular IR waveform to ir_plot.png",
},
},
Action: func(c *cli.Context) error {
// Read sweep WAV file
@@ -185,6 +190,16 @@ func main() {
return err
}
// Plot IR waveform if requested
if c.Bool("plot-ir") {
log.Printf("Plotting IR waveform to ir_plot.png...")
err := plot.PlotIR(ir, sampleRate, c.String("output"))
if err != nil {
return fmt.Errorf("failed to plot IR: %v", err)
}
log.Printf("IR plot saved as ir_plot.png")
}
// Generate MPT IR if requested
if c.Bool("mpt") {
log.Println("Generating minimum phase transform...")