How I got rid of heart palpitations:
I did some research and found a strong correlation with something called the "Gangus nerve" that connects the stomach, intestines and heart. It seems that in a large number of people, the palpitations are caused by indegestion. This applied to me so I did the following:
1) Stopped eating after 9 PM If I did eat after 7, I remained awake for at least 3 hours after eating in an upwards position (not laying down).
2) Limited the amount of chocolate and acids such as tomatoes in my diet
3) Slept on an incline so my upper body was inclined upwards relative to my lower body (using about 3-5 pillows).
4) Increased regular exercise and made sure I was breathing properly when performing strenuous exercises. Regular breathing is essential to proper heartbeats.
After a couple days of the above, the palpitations went away!