  We develop novel methods for using persistent homology to infer the homology
of an unknown Riemannian manifold $(M, g)$ from a point cloud sampled from an
arbitrary smooth probability density function. Standard distance-based filtered
complexes, such as the \v{C}ech complex, often have trouble distinguishing
noise from features that are simply small. We address this problem by defining
a family of "density-scaled filtered complexes" that includes a density-scaled
\v{C}ech complex and a density-scaled Vietoris--Rips complex. We show that the
density-scaled \v{C}ech complex is homotopy-equivalent to $M$ for filtration
values in an interval whose starting point converges to $0$ in probability as
the number of points $N \to \infty$ and whose ending point approaches infinity
as $N \to \infty$. By contrast, the standard \v{C}ech complex may only be
homotopy-equivalent to $M$ for a very small range of filtration values. The
density-scaled filtered complexes also have the property that they are
invariant under conformal transformations, such as scaling. We implement a
filtered complex $\widehat{DVR}$ that approximates the density-scaled
Vietoris--Rips complex, and we empirically test the performance of our
implementation. As examples, we use $\widehat{DVR}$ to identify clusters that
have different densities, and we apply $\widehat{DVR}$ to a time-delay
embedding of the Lorenz dynamical system. Our implementation is stable (under
conditions that are almost surely satisfied) and designed to handle outliers in
the point cloud that do not lie on $M$.
