added amplitude and frequency calculations