We propose a wavelet-based technique for the nonparametric estimation of functions contaminated with noise whose mean and variance are linked via a possibly unknown variance function. Our method, termed the data-driven wavelet-Fisz technique, consists of estimating the variance function via a Nadaraya-Watson estimator, and then performing a wavelet thresholding procedurewhich uses the estimated variance function and local means of the data to set the thresholds at a suitable level. We demonstrate the mean-square near-optimality of our wavelet esti- mator over the usual range of Besov classes. To achieve this, we establish an exponential inequality for the Nadaraya-Watson variance function esti- mator. We discuss various implementation issues concerning our wavelet esti- mator, and demonstrate its good practical performance.We also show how it leads to a new wavelet-domain data-drivenvariance-stabilising transform. Our estimator can be applied to a variety of problems, including the esti- mation of volatilities, spectral densities and Poisson intensities, as well as to a range of problems in which the distribution of the noise is unknown. Also available for download along with this paper is the R code for implementing the main algorithm of the paper: the data-driven wavelet-Fisz estimator and transform. The code requires the prior installation and loading of the R packages wavethresh, EbayesThresh, lokern (in R, go to Packages -> Install package(s)..., follow the instructions, and then issue the commands library(wavethresh), etc). Please contact the author if you make any modifications or improvements to it or if you have any questions. Also please reference all use of the code. The main routines are: ddhf.est, ddhf.trans, ddhf.trans.inv.