i would suggest you use randn() instead of rand().
The most straightforward way to produce band limited noise is to filter white noise.
you could conceivably use a Gibbs sampler but that would be less efficient and require knowing how to set up the problem.
Could you explain why you are making a distinction?
The simplest way I can think of to remove noise from this kind of recording would be to use the noise removal functions in Audacity (https://manual.audacityteam.org/man/noise_reduction.html). This allows you to select a section of noise with none of the target signal and get a noise profile. You then remove spectral content that fits with this profile, ...
The "lub dub" sound of a heart beat is primarily between about 30Hz and 40Hz.
A steep band pass filter for about 20Hz to 50Hz followed by amplification should bring out the beats themselves.
If you need other heart sounds, then it gets difficult.
Heart murmurs are a kind of wide band swishing noise - difficult or impossible to isolate using filters.
Median filter is considered good because unlike averaging filter which ruins the edges of an image by blurring it to remove the noise, median filter removes only the noise without disturbing the edges.
Well, median filter is the best and only filter to remove salt and pepper noise.
Hope this helps:)