Ok, so does the sampling interval in the frequency domain affect the scaling? In the example below, I have a fixed number of samples, `N`

. When I change `Ď‰max`

(the maximum frequency in the range), the amplitude of the ifft result changes even though `N`

does not change. The plots below are for `Ď‰max=4`

and `Ď‰max=20`

respectively. The time domain signal amplitude seems inversely related to the frequency sampling interval, despite N remaining constant. To recover the correct time domain signal amplitude it seems I need to include some other scaling factor related to frequency.

```
using FFTW
using SpecialFunctions
using Gaston #plotting package
#function to generate a frequency domain signal
function K0diff(Ď‰,r,râ€˛,z)
if Ď‰ == 0
result = log(râ€˛/r) + 0im
else
result = exp(1im*Ď‰*z)*(besselk(0,abs(Ď‰)*r) - besselk(0,abs(Ď‰)*râ€˛))
end
return result
end
#create a frequency domain function and apply irfft
N = 2^10
Ndiv2 = Int(floor(N/2))
Ď‰max = 4
Ď‰ = range(-Ď‰max,Ď‰max,length = N + 1)
frequencyDomainSignal = K0diff.(Ď‰,5,20,1)
p = plan_irfft(frequencyDomainSignal[Ndiv2+1:end],N,1)
timeDomainSignal = fftshift(p*frequencyDomainSignal[Ndiv2+1:end],1)
#output plots using Gaston
p1 = plot(real.(frequencyDomainSignal),Axes(xlabel = "'Frequency Index'",ylabel = "'Amplitude'"), handle = 1)
plot!(imag.(frequencyDomainSignal))
p2 = plot(timeDomainSignal,Axes(xlabel = "'Time Index'",ylabel = "'Amplitude'"), handle = 2)
plot([p1 ; p2])
```

with `Ď‰max=4`

with `Ď‰max=20`