Skip to content

Commit

Permalink
Merge pull request #33 from maetshju/rmplotsjl
Browse files Browse the repository at this point in the history
Add default ylim=(0, 5000) for phonspec
  • Loading branch information
maetshju authored Dec 28, 2023
2 parents f6318c9 + dc5aa13 commit 09da1c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/src/phon_spectrogram.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ using WAV
using Plots
s, fs = wavread("assets/iwantaspectrogram.wav")
s = vec(s)
phonspec(s, fs, ylim=(0, 5000))
phonspec(s, fs)
```

A color scheme more similar to the Praat grayscale can be achieved using the `col` argument and the `:gist_yarg` color scheme. These spectrograms are created using the `heatmap` function from `Plots.jl`, so [any color scheme available in the Plots package](https://docs.juliaplots.org/stable/generated/colorschemes/) can be used, though not all of them produce legible spectrograms.
Expand All @@ -23,7 +23,7 @@ using WAV # hide
s, fs = wavread("assets/iwantaspectrogram.wav") # hide
s = vec(s) # hide
using Plots # hide
phonspec(s, fs, , ylim=(0, 5000), col=:binary)
phonspec(s, fs, col=:binary)
```

A narrowband style spectrogram can be plotted using the `style` argument:
Expand All @@ -34,7 +34,7 @@ using WAV # hide
s, fs = wavread("assets/iwantaspectrogram.wav") # hide
s = vec(s) # hide
using Plots # hide
phonspec(s, fs, , ylim=(0, 5000), style=:narrowband)
phonspec(s, fs, style=:narrowband)
```

And, the pre-emphasis can be disabled by passing in a value of 0 for the `pre_emph` argument. Pre-emphasis will boost the prevalence of the higher frequencies in comparison to the lower frequencies.
Expand All @@ -45,7 +45,7 @@ using WAV # hide
using Plots # hide
s, fs = wavread("assets/iwantaspectrogram.wav") # hide
s = vec(s) # hide
phonspec(s, fs, , ylim=(0, 5000), pre_emph=0)
phonspec(s, fs, pre_emph=0)
```

# Function documentation
Expand Down
1 change: 1 addition & 0 deletions src/phon_spectrogram.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ phonspec
# an error
seriestype := :heatmap
clim := (-dbr, 0)
ylim --> (0, 5000)
spec.time, spec.freq, db
end

0 comments on commit 09da1c0

Please sign in to comment.