Same as the posterior code -- just modified to provide clean tone and get cosine distance
Same as the posterior code -- just modified to provide clean tone and get cosine distance