A novel method for on-line analysis of gas and particle composition