A 49-year-old woman presents with heavy, irregular menstrual bleeding over the past 6 months. She is perimenopausal, haemoglobin is 110 g/L and pregnancy test is negative. Pelvic examination is normal. What is the most appropriate initial investigation?