<blockquote>
<p>Centre a Gaussian weight function at each observed wavelength, use this to weight each point in the theoretical spectrum, calculate the average.</p>
</blockquote>
<p>Congratulations! You have (re-)discovered <a href="https://en.wikipedia.org/wiki/Convolution" rel="nofollow noreferrer">convolution</a>. It is sometimes a difficult thing to explain, so you are in luck because you've figured out exactly what to do without knowing about it ahead of time. Yay!</p>
<blockquote>
<p>Is this correct?</p>
</blockquote>
<p>Well, as long as your Gaussian is normalized to area=1, you don't want to average. Instead just sum them (add them all together) and multiply by <span class="math-container">$\text{d} \lambda$</span> the steps size of the &quot;finely spaced wavelength grid&quot; to maintain the same total area (brightness).</p>
<p>And then, only if:</p>
<ol>
<li>The shape of the resolution function of your instrument is really Gaussian, or at least pretty close to it. Otherwise use the actual measured shape</li>
<li>Your theoretical spectrum has already taken into account all other effects. Spectral features have finite line widths (anything that has a transition with a lifetime <span class="math-container">$\Delta t$</span> will have an associated energy spread <span class="math-container">$\Delta E$</span>  à la King the <a href="https://en.wikipedia.org/wiki/Uncertainty_principle#Energy%E2%80%93time_uncertainty_principle" rel="nofollow noreferrer">energ-time uncertainty principle</a>. That shape will actually be a <a href="https://en.wikipedia.org/wiki/Cauchy_distribution" rel="nofollow noreferrer">Lorentzian</a>.</li>
</ol>
<p>You can convolute many gaussian distributions by adding all their width parameters in quadrature:</p>
<p><span class="math-container">$$\sigma_{\text{Total}} = \sqrt{\sigma_1^2 + \sigma_2^2 + ...}$$</span></p>
<p>But if you have a Lorentzian and its width is significant, you will have to use a <a href="https://en.wikipedia.org/wiki/Spectral_line_shape#Voigt" rel="nofollow noreferrer">Voigt</a> distribution. Usually this is NOT a big effect, but you should always check first.</p>
<p>Further reading:</p>
<ul>
<li><a href="https://en.wikipedia.org/wiki/Spectral_line_shape#Line_shape_functions" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Spectral_line_shape#Line_shape_functions</a></li>
<li><a href="https://en.wikipedia.org/wiki/Spectral_line#Broadening_due_to_local_effects" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Spectral_line#Broadening_due_to_local_effects</a></li>
<li><a href="https://en.wikipedia.org/wiki/Spectral_line#Broadening_due_to_non-local_effects" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Spectral_line#Broadening_due_to_non-local_effects</a></li>
</ul>
<blockquote>
<p>(If so), what sigma should I use for the Gaussian?</p>
</blockquote>
<p>To get started with your convolution exercise, just choose an existing spectrometer instrument that might be related to the type of data you are thinking of. Go to its Wikipedia page or something better, and look up its resolution. If it's given as <a href="https://en.wikipedia.org/wiki/Full_width_at_half_maximum#Specific_distributions" rel="nofollow noreferrer">FWHM</a> you can convert to however you define your Gaussian.</p>

CC BY-SA 4.0
2024-05-27T19:32:46.917Z
According to the internet the spectral resolution is $$SR=\lambda/FWHM$$ For the spectrograph used, SR=735 is quoted for $\lambda=5580$ Angstrom , so FWHM=7.6. Furthermore for a Gaussian $$FWHM=2.35 \sigma,$$ so $\sigma=7.6/2.35=3.23$ Angstrom. Correct?
J. Webb
CC BY-SA 4.0
2024-05-28T02:47:17.687Z
@J.Webb Yes that certainly looks correct to me, and it's a reasonable number for a compact grating spectrometer. For example if you have a focal length of 10 cm, a 600 groove/mm grating and a 50 um wide slit, you might get (very roughly) FWHM ~ 8Å. But the line shape would be more flat-topped rather than a nice Gaussian. As I somewhat eluded to above, for preliminary work people will generally just use a Gaussian anyway. For final analysis one carefully measures the response (line shape) of the spectrometer using very narrow spectral lines, and convolutes with the measured shape.
uhoh
CC BY-SA 4.0
2024-05-28T15:27:39.360Z
Thank you for spending the time to give a detailed answer.
J. Webb
CC BY-SA 4.0
2024-05-27T07:11:54.053Z
2024-05-27T07:11:54.053Z
uhoh
<p>I want to fit a theoretical spectrum on a finely spaced wavelength
grid to an observed stellar spectrum at coarser resolution. I understand
that I have to apply convolution to the theoretical spectrum to degrade
its resolution to the same as the observed spectrum. I haven't seen
an explicit description of the details anywhere, but I guess it would be
something like this:
Centre a Gaussian weight function at each observed wavelength,
use this to weight each point in the theoretical spectrum,
calculate the average.
Is this correct? If so, what sigma should I use for the Gaussian?</p>

CC BY-SA 4.0
2024-05-27T11:13:55.303Z
*"If so, what sigma should I use for the Gaussian?"* Well, that would be the result of the fitting. You just vary sigma until the convolution result matches the observed spectrum. Normally, the problem would be the other way around though: you know the instrumental profile and change the parameters in your theory to achieve a match.
Thomas
CC BY-SA 4.0
2024-05-27T19:25:22.430Z
Thank you, that makes sense, but looks like more work than I would like to do for my simple application.
J. Webb
<spectroscopy>
Degrade resolution of theoretical spectrum before fitting
J. Webb
# Degrade resolution of theoretical spectrum before fitting

(Asked by: username_0 on 2024-05-26)

I want to fit a theoretical spectrum on a finely spaced wavelength
grid to an observed stellar spectrum at coarser resolution. I understand
that I have to apply convolution to the theoretical spectrum to degrade
its resolution to the same as the observed spectrum. I haven't seen
an explicit description of the details anywhere, but I guess it would be
something like this:
Centre a Gaussian weight function at each observed wavelength,
use this to weight each point in the theoretical spectrum,
calculate the average.
Is this correct? If so, what sigma should I use for the Gaussian?

**Tags:** spectroscopy
> **Comments:**
> **username_1**: *"If so, what sigma should I use for the Gaussian?"* Well, that would be the result of the fitting. You just vary sigma until the convolution result matches the observed spectrum. Normally, the problem would be the other way around though: you know the instrumental profile and change the parameters in your theory to achieve a match.  
> **username_0**: Thank you, that makes sense, but looks like more work than I would like to do for my simple application.  

---

## 1 answers

### Answer by username_2 on 2024-05-27. Score: 3 | Accepted answer

> Centre a Gaussian weight function at each observed wavelength, use this to weight each point in the theoretical spectrum, calculate the average.

Congratulations! You have (re-)discovered [convolution](https://en.wikipedia.org/wiki/Convolution). It is sometimes a difficult thing to explain, so you are in luck because you've figured out exactly what to do without knowing about it ahead of time. Yay!

> Is this correct?

Well, as long as your Gaussian is normalized to area=1, you don't want to average. Instead just sum them (add them all together) and multiply by $\text{d} \lambda$ the steps size of the "finely spaced wavelength grid" to maintain the same total area (brightness).

And then, only if:

1. The shape of the resolution function of your instrument is really Gaussian, or at least pretty close to it. Otherwise use the actual measured shape
2. Your theoretical spectrum has already taken into account all other effects. Spectral features have finite line widths (anything that has a transition with a lifetime $\Delta t$ will have an associated energy spread $\Delta E$ à la King the [energ-time uncertainty principle](https://en.wikipedia.org/wiki/Uncertainty_principle#Energy%E2%80%93time_uncertainty_principle). That shape will actually be a [Lorentzian](https://en.wikipedia.org/wiki/Cauchy_distribution).

You can convolute many gaussian distributions by adding all their width parameters in quadrature:

$$\sigma\_{\text{Total}} = \sqrt{\sigma\_1^2 + \sigma\_2^2 + ...}$$

But if you have a Lorentzian and its width is significant, you will have to use a [Voigt](https://en.wikipedia.org/wiki/Spectral_line_shape#Voigt) distribution. Usually this is NOT a big effect, but you should always check first.

Further reading:

* <https://en.wikipedia.org/wiki/Spectral_line_shape#Line_shape_functions>
* <https://en.wikipedia.org/wiki/Spectral_line#Broadening_due_to_local_effects>
* <https://en.wikipedia.org/wiki/Spectral_line#Broadening_due_to_non-local_effects>

> (If so), what sigma should I use for the Gaussian?

To get started with your convolution exercise, just choose an existing spectrometer instrument that might be related to the type of data you are thinking of. Go to its Wikipedia page or something better, and look up its resolution. If it's given as [FWHM](https://en.wikipedia.org/wiki/Full_width_at_half_maximum#Specific_distributions) you can convert to however you define your Gaussian.

> **Comments:**
> **username_0**: According to the internet the spectral resolution is $$SR=\lambda/FWHM$$ For the spectrograph used, SR=735 is quoted for $\lambda=5580$ Angstrom , so FWHM=7.6. Furthermore for a Gaussian $$FWHM=2.35 \sigma,$$ so $\sigma=7.6/2.35=3.23$ Angstrom. Correct?  
> **username_2**: @J.Webb Yes that certainly looks correct to me, and it's a reasonable number for a compact grating spectrometer. For example if you have a focal length of 10 cm, a 600 groove/mm grating and a 50 um wide slit, you might get (very roughly) FWHM ~ 8Å. But the line shape would be more flat-topped rather than a nice Gaussian. As I somewhat eluded to above, for preliminary work people will generally just use a Gaussian anyway. For final analysis one carefully measures the response (line shape) of the spectrometer using very narrow spectral lines, and convolutes with the measured shape.  
> **username_0**: Thank you for spending the time to give a detailed answer.  

---

