I'm trying to use lfs(linear frequency shift) function on a wav file I recorded using R. Here is the code I ran, and features of my wav file.
library(tuneR)
library(MASS)
library(seewave)
setwd("C:/Users/Minkyung/Desktop/Call made")
bull <- readWave("croak_origin_bpf.wav")
#STDFT matrix
f <- bull@samp.rate ; wl <- 8192; ovlp <- 50; wn <- "rectagle"
data <- spectro(bull, wl=wl, ovlp=ovlp, wn=wn,
plot=FALSE, norm=FALSE, dB=NULL, complex=TRUE)
LF.croak <- lfs(bull, shift=-25, output="Wave")
HF.croak <- lfs(bull, shift=+75, output="Wave")
writeWave(object=normalize(MF.croak, unit="16"),
filename="LF.croak_origin_bpf.wav")
writeWave(object=normalize(HF.croak, unit="16"),
filename="HF.croak_origin_bpf.wav")
#> bull
#> Wave Object
#> Number of Samples: 44272
#> Duration (seconds): 1
#> Samplingrate (Hertz): 44100
#> Channels (Mono/Stereo): Mono
#> PCM (integer format): TRUE
#> Bit (8/16/24/32/64): 16
When I run this code, there's an error for lower shifting function.
LF.croak <- lfs(bull, shift=-25, output="Wave")
> Error in lfs(bull, shift = -25, output = "Wave") :
> 'shift' value cannot be less than the frequency resolution (f/wl)
I realize the frequency resolution cannot be under 0, but in that case is it impossible to use lfs function as a way to lower the frequencies? But in some examples I do find lowering frequencies are possible. Any ideas?