Add some older Theory projects from the past years
This commit is contained in:
18
Functions/Theory/calcFWM/wavelength2frequency.m
Normal file
18
Functions/Theory/calcFWM/wavelength2frequency.m
Normal file
@@ -0,0 +1,18 @@
|
||||
function frequency = wavelength2frequency(wavelength, inputUnit)
|
||||
% Convert wavelength to optical frequency.
|
||||
% Supported units: m, nm.
|
||||
|
||||
c = physconst('LightSpeed');
|
||||
|
||||
switch lower(inputUnit)
|
||||
case 'm'
|
||||
wavelength_m = wavelength;
|
||||
case 'nm'
|
||||
wavelength_m = wavelength .* 1e-9;
|
||||
otherwise
|
||||
error('Unsupported input unit "%s". Use "m" or "nm".', inputUnit);
|
||||
end
|
||||
|
||||
frequency = c ./ wavelength_m;
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user