Algebraic independence of certain Mahler functions constructed from Rudin-Schapiro sequences and Baum-Sweet sequences is proved, using difference Riccati equations and the notion of difference field extension of valuation ring type.