You can learn a lot about a star even though it may be 1000 light years away by examining the light that came from it . Using a diffraction gradient you can split a beam of light into it's individual wavelengths, just like water droplets splitting sunlight into a rainbow.
Measuring the intensity of light observed at each wavelenght gives the stars a characteristic spectrum.
In this project, I will work on a practice activity from Matlab Onramp course. I will use Matlab to find the observed wavelengh of hydrogen alpha line of HD94028 , a faint star in the constellation of Leo ,and to compare it to the know wavelength of hydrogen absorption to determine how fast the star is moving away from Earth.
To do this we wiil be inspecting the spectrum of HD94028
In this spectrum , note the deep spike in the spectrum , which means not much light is being radiated at this particular wavelength around 650 nanametres. This is a common future of many stars because Hydrogen , a major component of most stars, absorbs light at precisely 656.3 nanometres
However on a closer look up , this spike in HD94028's spectrum , hydrogen alpha line occurs at a slightly longer wavelength than 656.3 nanometres.
This is because the star is moving aways from the earth. Just like a sound emitting object becomes louder as it comes towards you and lowers the sound as it moves away , a star spectrum is blue shifted that is shifted to shorter wavelenghts if it's moving toward you and redshifted to longer wavelengths if it moves away.
With precise spectral measurements over time , astronomers use this technique to discover the slight oscllications that demaostrate the presence of planets.