hpr4658 :: Audio Revisited
This is a follow up to the series on Simple Podcasting showing the results of filtering experiments
Hosted by Whiskeyjack on Wednesday, 2026-06-10 is flagged as Clean and is released under a CC-BY-SA license.
audio recording.
(Be the first).
Listen in ogg,
opus,
or mp3 format. Play now:
Duration: 00:50:23
Download the transcription and
subtitles.
general.
01 Introduction
This is a follow up to my 4 part series on simple podcasting.
In this episode I will discuss a number of experiments with audio filtering.
These experiments were inspired by comments by listeners and by other discussions about audio on HPR.
I am not an audio expert, so I am doing this partly in order to learn something, but mainly in order to have a bit of fun.
I hope that you find this entertaining as well.
In a comment on the first episode a listener mentioned something called Solocast and said that the method bore a resemblance to the method that I was using.
Here is his comment
--------------------
02
Comment #3 posted on 2026-04-03 07:49:58 by Reto
It reminds me about Solocast
Hi Whiskeyjack,
I really liked your podcast and the topic. I cannot remember about your last, but the sound quality of this one was good on my mobile speakers :)
The concept reminded me about the program from Norrist (another host on HPR), while similar does it have some differences HPR 3496 https://hackerpublicradio.org/eps.php?id=3496
As I am not on the future feed, I look forward to your next episode.
Cheers, Reto
--------------------
03
End of comment.
I did not recall having heard the episode on Solocast, but this sounded very interesting. Solocast was in HPR episode 3496 and was released by norrist on the 27th of December 2021.
I listened to that episode and does indeed use use the same basic concept of recording short segments of audio and combining them later instead of creating one big recording and editing it with an audio editor.
04
The main difference is that the work flow that I described involves a lot of manual steps, while Solocast is a short Python program that automates the entire process of presenting your script, recording the segments, combining the segments, and filtering and normalizing the result.
I won't try to describe Solocast in detail, instead I would recommend just listening to HPR episode 3496 to get norrist's explanation directly.
--------------------
05
While I wanted to make sure that I credited norrist with having come up with this concept four years before I did, this won't be the focus of this episode.
Instead I will talk about audio filtering and various experiments that I ran on several different methods.
06
While looking at the source code for Solocast I noticed that it used a filtering method that resembled one used by Jivetalk, a podcast production program that caught the attention of one of the HPR community news presenters.
This method involves taking a sample of quiet audio where there is no speaking taking place, and then using this as input to a noise reduction filter which is applied to the voice recording.
The filter subtracts the quiet sample from the voice audio, which should theoretically remove the ambient noise.
07
I decided to apply this method to a number of different audio test recordings which were recorded under different circumstances using different hardware.
In this way I could see if the method worked equally well under all circumstances or if there were some sorts of noise which it was suited to and some sorts that were not.
08
While I was at it, I also picked several other filter methods to see how they worked as well.
Potentially, some methods may be better under some conditions while other methods were better suited to others.
--------------------
09
I won't present all of my experiments, as that would be a bit dull to listen to.
Instead I will describe each method and then present audio samples which illustrate my conclusions.
There are two pieces of audio software involved, both of which were also used in my series on simple podcasting.
10
The first is Sox, spelled s o x , and which is short for Sound Exchange.
Sox is a command line program for audio manipulation.
Sox is Free Software, released under the GPLv2 or later.
The other is FFMPEG, which is also a command line program.
FFMPEG is also Free Software, released under the LGPL V 2.1 or later, and GPL v 2 or later.
Sox actually uses FFMPEG for certain operations.
--------------------
11 Audio Hardware
For recording hardware I used the following.
12 Maxwell Headset
The first is a cheap Maxwell headset that has an electrical noise problem. Unfortunately I don't have a model number for this headset.
I described this hardware, the noise problems that I had with it, and how I created filters to deal with the noise in my series on simple podcasting.
Briefly though, this is a headset that has a build in microphone on a boom which allows the microphone to be positioned close to the mouth.
It connects with a USB cable.
13 Borne Earpiece and In-line Microphone
This is a set of earplugs that go in your ears and connected by wires and a very small microphone built into a small bulge in the cable. It connects using a 3.5mm jack.
The model number seems to be BUD250-BL.
14 XTrike Headset
This is a gaming headset similar to the Maxwell headset described above.
The model number is GH-510
It uses a USB connection.
15 Yanmai Condenser Microphone
This is a microphone that comes with a small tripod stand.
The model number is SF-910
It uses a 3.5mm audio jack.
--------------------
16
This is not a review of the hardware.
Rather, I was trying to create audio problems so that I could test ways to fix them.
Therefore, do not take the above list as a recommendation of what to buy.
However, you can see that I am not using any expensive audio hardware.
If you want to make an HPR podcast, you do not need professional level hardware.
--------------------
17 Audio Samples
The audio samples are as follows
18 Quiet
This was recorded in a quiet environment at my desk.
This is my normal podcasting environment and represents optimal conditions.
The main reason for this method is to see how the various filter methods perform when dealing with the electrical noise from the Maxwell headset.
19 Small fan
This is a small USB powered table fan approximately 10 cm in diameter.
It was located roughly 40 cm or less to the left of the microphone, although this varies depending on the microphone.
20 Traffic
This was along a busy street with traffic noise in the background.
--------------------
21 Filter Methods
Sox noisered Filter with Audio Profile
This method uses the Sox noisered filter. Here is a brief quote from the Sox documentation on this filter.
Quote
Reduce noise in the audio signal by profiling and filtering. This effect is moderately effective at removing consistent background noise such as hiss or hum. To use it, first run SoX with the noiseprof effect on a section of audio that ideally would contain silence but in fact contains noise - such sections are typically found at the beginning or the end of a recording.
End of quote
For these tests I recorded a separate noise profile to go with each test.
--------------------
22 Basic Manual Filter
This is a basic high and low pass filter pair based on the work I had done in my previous series on simple podcasting.
However, based on the tests that I have done for this episode, I decided to get a bit more aggressive in terms of filtering.
I use a high pass filter of 120 Hz, and low pass filter of 8 kHz.
The each filter is then applied twice to increase its effect.
I also added band reject filters to deal specifically with 50 and 60 Hz line noise.
--------------------
23 Complex Manual Filter
This uses the manually constructed filter described in my series on simple podcasting.
This uses the basic manual filter plus a series of custom bandreject filters to fix specific noise problems with the Maxwell headset.
--------------------
24 FFMPEG afftdn Filter
The documentation describes this as
"Denoise audio samples with FFT."
--------------------
25 FFMPEG arnndn Filter
The documentation describes this as
"Reduce noise from speech using Recurrent Neural Networks."
--------------------
26 FFMPEG agate Filter
I will pronounce this as "agate" for convenience.
The documentation describes this as
"A gate is mainly used to reduce lower parts of a signal.
This kind of signal processing reduces disturbing noise between useful signals."
--------------------
27 Method
The experimental method used was to take each noise sample and apply the different filter methods to it.
Where there are parameters which can be adjusted, a script was used to generate a series of different sample files with different parameter values.
Not all possible parameters were experimented with, as the goal is to see which method produces what sorts of results under different circumstances, not to get the best possible result for the samples that I happen to have.
The method in each case was as follows
28 Step 1
Convert the audio file to FLAC if it is not already in that format.
29 Step 2
Apply a basic high and low pass filter described previously to each sample.
The reason for this basic filtering is that it eliminates at least some undesired noise in a fairly fool proof manner, leaving less for the more advanced filter to deal with.
This should allow for a better test of the filter under realistic conditions.
30 Step 3
Apply the noise reduction filter being tested.
31 Step 4
Normalize the filtered sample to 17 LUFS according to the EBU R128 standard.
The EBU standard is described in my series on simple podcasting.
Normalizing adjusts the audio signal to a desired loudness level.
This allows for more more consistent sound levels and allows us to hear the results under realistic conditions.
I normalize the audio individually for each sample as different recording hardware requires different amounts of loudness adjustment.
This is different from the typical podcast process where normalizing takes place as the very last step in the process, but it was necessary in this case.
32 Step 5
Concatenate selected sample audio files to one another to allow for better review and comparing.
--------------------
33 Results
The results are grouped according to the type of noise which is being mitigated. This allows for easier comparison of the effectiveness of each technique under different circumstances.
I have only picked a few examples of interest out of the numerous experiments that I conducted.
--------------------
34 Quiet Recording Environment with Maxwell Headset
This compares how well the various filtering methods work on the noise induced by the electronics in the Maxwell headset.
This electronic noise consisted of a noise spike every 1 kHz.
This should be representative of electronic noise caused by problems in recording hardware.
35 Manual Filter
The manual filter applied a narrow band reject filter every 1 kHz from 1 kHz to 12 kHz.
This completely removed the otherwise audible whine caused by the noise.
36 FFMPEG afftdn
This method allows for setting a noise floor and then specifying how much the noise floor should be reduced by.
The method is very sensitive to getting the noise floor correct for that recording. Set the floor too low and nothing happens. Set it too high, and some distortion results.
However it seemed to be moderately effective, but it would seem to require checking it and possibly adjusting it each time it is used.
37 FFMPEG agate
This method allows setting a noise floor and then suppressing all sound which falls below that level.
This method is very sensitive to getting the noise floor correct for that recording.
If set too low (or quiet), it is ineffective.
If set too high (or loud), it distorts words which come after a pause, which would typically be between sentences.
38
When set correctly, it completely removes noise in the silences between sentences.
However, the noise is still audible during speech.
This is because the noise in this case is a higher frequency than normal speech, and so stands out more.
It may not be a significant problem for noise which is closer to the main vocal frequency band.
Overall, this method is not suitable for this particular problem.
39 FFMPEG arnndn
This method used the standard model.
A variety of different noise reduction models are available.
I only tested it with one, std.rnnn
It does not seem to introduce much distortion in the voice signal even with a high amount of mix parameter.
40
However, it is only slightly effective at removing the whine from the signal, even with a high amount of mix parameter.
Overall, this method does not appear to be useful for this sort of noise problem.
41 Sox noisered Filter
This was effective in removing noise between words, but noise can be heard while words are being spoken. It was better than agate however.
42 Overall Conclusion for the Maxwell Headset Noise
When dealing with narrow noise bands that occur at known frequencies, the manual filter is leagues ahead of any of the other tested alternatives.
43 Sample Audio
Here is a sample audio recording showing the best overall results
The sample is repeated, first with only basic low and high pass filtering, and then with the manually constructed filtering.
In the first sample you should hear a high pitched background whine.
In the second sample, the high pitched whine is completely removed.
44 (Audio sample inserted here.)
--------------------
45 Traffic Noise
This was recorded using the Borne in-line microphone connected to a mobile phone while walking along beside a busy street.
This was in dry cool spring weather, and the road was paved with asphalt.
This should be reasonably representative of podcasting while walking outdoors in a noisy environment.
46 Basic Manual Filter
This used the basic manual filter with high and low pass filters. This did nothing very useful in this case as the signal was already filtered within those limits by the recording hardware anyway. The low sample rate of 8 kHz in the phone limited the upper frequency to 4 kHz. Recall that the sample rate has to be twice the highest frequency that you want to detect.
Overall, this is not suitable for this sort of problem.
47 FFMPEG afftdn
With a high noise floor, background noise is reduced, but not eliminated. There was not much distortion in the voice.
This is only slightly useful for this sort of problem.
48 FFMPEG agate
With a high threshhold, background noise is reduced, but not eliminated. There was some distortion in the voice.
The background noise could also be heard when speaking, but because the frequency of the background signal was similar to the louder voice signal, it was not as noticeable as it would have been if the two were very different.
This is moderately useful for this sort of problem. It may be more useful in situations where the background noise was not quite as loud.
49 FFMPEG arnndn
With high amounts of noise reduction, much of the background noise is suppressed, but there is not a lot of distortion in the voice.
The background traffic noise is still present, but is significantly less.
This offers only a moderate improvement.
50 Sox noisered Filter
With small amounts of noise reduction voice is clear but traffic noise is present as a very significant continuous warbling sound in the background.
This is no improvement on the original and in fact could be seen as making it worse.
With moderate amounts of noise reduction, traffic noise is mostly gone, but there are still various squeaks present. Voice is noticeably distorted.
With large amounts of noise reduction, traffic noise is gone but voice is highly distorted.
This is moderately useful for this sort of problem, but requires careful adjustment.
51 FFMPEG arnndn Followed by FFMPEG agate
This combined two different filters.
First, it used arnndn to suppress the background noise to a lower level without much voice distortion.
Then it applied the agate filter to suppress the noise levels between words still further.
This used the same amount of mix and threshold as was found to be most effective when each of these filters was used on its own.
The background noise is almost completely gone while distortion of the voice signal is low.
52 Overall Conclusion for Traffic Noise
The arnndn combined with agate filters was the most successful at suppressing background noise while limiting the amount of voice signal distortion.
53 Sample Audio
Here is an audio sample for what I felt to be the best overall results, the arnndn filter combined with the agate filter.
First is the original audio with basic filtering.
This is followed with the same audio after being passed through the arnndn and agate filters.
54 (Insert arnndn plus agate audio sample here)
55 Another Sample
Here is a second audio sample showing the Sox noisered profile based filter.
I have included this to show how a profile based filter can make things worse if you are not careful how you use it.
This repeats the test audio 4 times.
The first is with basic filtering only.
The second uses low amounts of noise reduction.
The third uses moderate amounts of noise reduction.
The fourth uses high amounts of noise reduction.
56 (Insert noisered audio sample here)
--------------------
57 Small Fan Noise with Yanmai Microphone
This was recorded using the Yanmai condenser microphone.
A small fan was set up behind and to the left of the microphone.
This is intended to represent situations where someone may have a fan or air conditioner running in the background due to hot weather, or has a loud computer fan.
58
A condenser microphone was used for this test as they are more prone to picking up unwanted noise.
However, for practical recording purposes, this sort of microphone is unsuitable for this type of environment.
59 Basic Manual Filter
This used the basic manual filter with high and low pass filters.
This did nothing useful as the fan noise was in the same frequency range as the voice signal.
This may be of more help in cases where the noise is below the 120 Hz cut off used in the low pass filter.
60 FFMPEG afftdn
With high amounts of noise reduction, much of the background noise is suppressed, but there is some distortion in the voice.
The background fan noise is still present, but is significantly less.
Overall this is moderately effective.
61 FFMPEG agate
This was effective in removing noise between words, but noise can be heard while words are being spoken.
However, this was a small voice sample and it is possible that more problems could occur.
With less fan noise than was in this sample this technique may work much better.
62 FFMPEG arnndn
With high amounts of noise reduction, much of the background noise is suppressed, but there is not a lot of distortion in the voice.
The background fan noise is still present, but is significantly less.
Overall this was fairly effective.
63 Sox noisered Filter
With small amounts of noise reduction voice is clear but fan noise is present as a slight warbling sound in the background.
With moderate amounts of noise reduction, fan noise is gone, but voice is somewhat distorted.
With large amounts of noise reduction, fan noise is gone but voice is very distorted.
64
In general this method is fairly successful at dealing with this sort of problem.
However, there is a trade off between background noise and voice quality.
Getting that trade off correct takes experiment and judgment for each specific situation.
65 FFMPEG arnndn Followed by FFMPEG agate
This combined two different filters.
First, it used arnndn to suppress the background noise to a lower level without much voice distortion.
Then it applied the agate filter to suppress the noise levels between words still further.
This got rid of virtually all of the background noise between words.
If you listen carefully however, there is a slight buzzing sound in the voice signal.
66 Overall Conclusion for Fan Noise with Yanmai Microphone.
Of the methods tested, the arnndn followed by agate filter seemed to offer the most improvement for the least effort and least voice distortion.
The arnndn filter on its own seemed the next most preferable to me despite leaving some fan noise in the background.
67 Audio Sample
Here is an audio sample for what I felt to be the best overall results, the arnndn filter combined with the agate filter.
First is the original audio with basic filtering.
This is followed with the same audio after being passed through the arnndn and agate filters.
68 (Insert audio sample here)
--------------------
69 Small Fan Noise Recorded with Headset
The following is an observation rather than a filtering technique.
When a recording was made using the Maxwell headset and listened to on the headset later or with speakers, the fan was virtually inaudible.
When the same recording was listened to with the XTrike headset, it was barely audible with careful listening and only identifiable as a fan because I knew it was there.
70
In situations where there is ambient noise, the best noise reduction technique is probably to move the microphone as close to your mouth as possible, although not directly in front of it, and reduce the gain if there is a gain adjustment in the microphone.
This will work far better than trying to remove the noise later.
If you are recording an HPR episode at a desk, then an inexpensive headset with boom mike may do the job just fine with minimal effort and expense.
--------------------
71 Conclusions
I have tested three noise scenarios -
Electronic noise in the audio hardware at specific frequencies.
Recording outdoors with an inline microphone in a noisy traffic environment.
A noisy fan creating background noise in an office.
My conclusions on these are as follows.
72 Electronic Noise in the Audio Hardware at Specific Frequencies
If you can use Audacity or some other means to find the frequencies which are causing the noise, the best solution, assuming you don't just replace the hardware, is to manually construct filters to remove those specific frequencies.
This is the safest solution in terms of only doing what you tell it to and not producing unexpected surprises some time down the road when something changed in the environment.
73
If you are looking for a fairly automatic filtering method, the Sox noisered profile based filter seems to work fairly well.
There is an equivalent filter in ffmpeg, but I did not include that in my experiments as it is harder to use in a script because it does not use a separate noise profile file.
74 Recording Outdoors with an Inline Microphone in a Noisy Traffic Environment.
In this situation, the FFMPEG arnndn combined with agate filters seem to be the most successful.
The Sox noisered filter may work, but at the cost of more distortion in the voice than is seen in the other methods.
75
An inherent problem with any profile based noise reduction method is that if the background noise is not constant, which it seldom is in that sort of environment, the profile may not represent the background noise which is present later on in the recording.
This risks adding more distortion in the voice as the profile and later environments diverge.
76
However, for this application a different microphone that provided a better recording would appear to be advisable.
A solution which brought the microphone much closer to the mouth and so resulted in a better ratio of voice signal compared to background noise would appear to be necessary, after which the question of what sort of noise reduction to use would need to be re-evaluated.
77 A Noisy Fan Creating Background Noise in an Office.
The Sox noisered filter and the FFMPEG arnndn, afftdn, and agate methods all work to some degree.
However, they all need correct selection of parameters to achieve the proper results.
When I compared all four methods side by side, I found the arnndn combined with the agate filter to be preferable in terms of the trade off between background noise reduction and distortion of the voice signal.
The arnndn filter on its own seemed the next most preferable to me despite leaving some fan noise in the background.
78
However, that is a subjective judgment of a specific noise sample when recorded using a specific microphone.
Keep in mind though that many listeners will not be listening in an idea environment.
They may be doing things where background noise is present rather than in a very quiet room and so may find a small amount of background noise in the recording to be less of a problem than distortion in the voice signal which may make some words harder to understand.
79
When I conducted the same experiment recorded with the XTrike headset I found that arnndn seemed to offer no noticeable improvement.
This may be because the amount of audible fan noise was far less with the XTrike headset to begin with.
In other words, there is no single best solution here, and you may have to be prepared to try different options to see which one works in your situation.
The important thing is to avoid making things worse by applying filtering that is not appropriate for that situation.
The best method may be to use a recording method that doesn't pick up the fan noise to begin with.
This can include just using a gaming headset with boom mic.
80
I have one final observation on this point regarding headsets.
The Maxwell headset has a foam cover over the microphone while the XTrike headset does not.
There was some slight audible wind buffeting noise picked up by the XTrike headset that was not observed with the Maxwell.
This seemed to cause particular problems with the Sox noisered profile based filter, as this noise was irregular and after filtering would show up as a warbling sound.
If you use a headset and plan to use it in conjunction with a fan, it may be advisable to apply some sort of wind cover over it.
81 Combining Complex Filters
In several cases I found that combining several complex filters offered better results than using any single one on its own.
The basic strategy though is to first use a method which is good at reducing undesirable noise without introducing excessive voice distortion.
Then apply a different filter which is good at reducing small levels of background noise to an even lower level while affecting the voice signal as little as possible.
This uses the relative strengths of different filter types to compensate for the weaknesses of the other.
82
Different combinations of filters were most effective for different types of problems.
I did not try all possible combinations however.
Perhaps a further exploration of this would be worth doing in a later podcast.
--------------------
83 Case Study - Noise in Another HPR Episode Audio
In the comments to my second episode on Simple Podcasting (which is HPR4618) where I discussed basic filtering, a couple of listeners brought up an interesting point.
Antoine mentioned "declicking" in a post.
--------------------
Vance replied
84
Antoine, thanks for mentioning the click removal capability in Audacity! While I already knew about its noise removal filter, I wasn't aware it also had click removal.
It might have helped me for HPR4637, where some sort of electromagnetic signal was picked up by my microphone/recorder, a Zoom H2 (the tapping sound was *not* present in the room where I recorded).
While click removal does seem to distort speech when applied to it (though to my ears, it doesn't sound as weird as when noise removal is done with speech), I could have applied the filter only to the pauses, where the "tapping" is most noticeable. I will consider doing this in the event that I'm not able to eliminate the source of interference in the future, which would be the best way to go.
--------------------
85
End of quote.
I found this interesting as it sounded like another audio problem that could be experimented with.
I found a sample of the episode which had the clicks and cut a copy of that segment out to experiment with.
These sounds are a series of clicks, or "ticks" would be another way to describe them, in the quiet part of the audio between sentences or phrases.
86
Next I used Audacity to study the sound spectrum.
I found a massive 60 Hz noise spike.
However, my speakers won't reproduce sound that low, and filtering this out didn't reduce the clicks.
The clicks turned out to be bursts of noise across the 100 to 800 Hz band, which is right where the main vocal band also is.
This makes it difficult to filter based on frequency.
The most promising approach would seem to be to filter based on sound level.
87
I tried all of the individual audio filter techniques mentioned in the other experiments above.
None produced satisfactory results except for agate, which makes quiet audio quieter.
This completely suppressed the clicks.
However, when applied to the entire episode it also distorted the start of a few sentences which began with single short syllables.
88
The agate filter has a number of parameters which could be adjusted to try to deal with these cases, although I did not spend the time to do so.
Another solution to this distortion problem is to simply not apply the filter to those parts of the audio which are affected.
If you record the audio as a series of small individual files, it would be easy enough to filter before concatenating the files together while skipping those files which contain audio which is not suited to this method.
Here are the results of the experiments.
89 FFMPEG afftdn
This reduces the size of of the ticks, but they are still present.
However, they may be reduced to a level which is considered acceptable.
90 FFMPEG agate
This was very effective in removing ticks with the right parameters.
However, it can introduce some voice distortion in the form of cutting out the start of a few sentences which began with single short syllables.
This can be corrected with a very short "attack" parameter to turn off the filter when it detects sound above a set threshhold.
91 FFMPEG arnndn
This was relatively ineffective.
92 Sox noisered
This was effective in removing the sounds between phrases.
However, it introduces some distortion in the voice signal.
93
I also tried combining filters.
FFMPEG afftdn Followed by agate
This combined two different filters.
First, it used afftdn to suppress the background noise to a lower level without much voice distortion.
Then it applied the agate filter to suppress the noise levels between words still further.
This got rid of virtually all of the background noise between words.
94
Here is a short audio sample from HPR4637.
First is the unfiltered audio.
Second is the filtered audio using the combined afftdn plus agate filters.
Since the "clicks" are very quiet, you may not hear them unless you are in quiet environment.
Quite a few listeners would probably not be aware of the perceived audio problem in this episode if it had not been discussed here.
None the less, it makes for an interesting experiment.
Here it is:
95 (Insert sample audio here)
96 Overall Conclusion for Noise "Ticks"
The afftdn combined with agate filters seemed to offer the best overall results when used with the right parameters.
However, the author, Vance, speaks very clearly and evenly, and so his voice is ideally suited for use with this filter.
Another author's voice may not be as suited to this filter.
97
The Sox noisered profile based filter offers various degrees of trade off between suppressing noise and distorting the voice signal.
As to whether this is an acceptable trade off depends on the particular voice in question and how easily understood it is under normal circumstances with out additional distortion.
The afftdn filter may be a fairly safe filter to use on its own while producing acceptable if not perfect output.
--------------------
98 Overall Conclusions
I have presented only a few of the experiments that I conducted.
My overall conclusion after all of this is that there is no universal audio filtering method that works best in all circumstances.
There are instead a number of tools in the toolbox, and picking the right one for the job takes a bit of trial and error.
99
However, if you have a repeatable recording environment, then once you have decided what tool you need you should create a script for it so you can have a repeatable processing setup.
These conclusions apply to voice podcasting.
Music has a different set of criteria and techniques that work well with basic voice podcasting may produce poor results when applied to music which has a broader range of frequency and just as importantly, a broad range of loudness.
100
If you are used to using filters and effects in Audacity, many of the settings on those correspond to arguments in the command line version of ffmpeg.
It is worth learning how to use ffmpeg directly to automate your recording process.
101
The experiments that I conducted were greatly assisted by writing scripts which created multiple versions of audio files with different settings, thereby allowing me to try many different alternatives relatively easily.
It also allowed me to concatenate different audio samples into a single audio file and so listen to different versions in quick succession, making subjective listening judgments more reliable.
102
It is important to keep in mind in all this that I am playing with audio filtering mainly to have fun.
It is not necessary to do any of this if you think your podcast episode sounds just fine without it.
So, don't let any of what I have talked about in all this discourage you from simply recording a podcast and sending it in as is.
I will include copies of the filters I have described here in the show notes.
--------------------
103 Related Matters
Hardware Characterization Using Audio Signals
I found it useful to characterize the hardware that I had in order to understand its limitations better before starting the experiments.
This involved playing a signal out through a set of speakers and then recording it through a microphone.
104
I used two types of signal for this.
One is type of signal is known as a "chirp" signal.
This is a sine wave that steadily increases in frequency as it sweeps across the audio spectrum.
The standard audio range is 20 Hz to 20 kHz, but for my purposes I limited the upper frequency to 15 kHz to save time as anything beyond that is not very useful for voice podcasts.
105
By recording the chirp signal with a microphone and analyzing it with a Fourier transform, I could quickly see what each device was capable of.
See my previous series on simple podcasting for an explanation of what a Fourier transform is and what software to use to see the results of it.
Here is a chirp signal.
106 (Insert Audio Sample Here)
107
In addition to a chirp signal, I also used a series of simple tones of specific frequencies.
By using these tones of known frequency I could gain an understanding of the limitations of my speakers and headphones, and just as importantly, my own ears.
By understanding these limitations I was able to narrow the range of frequencies that I need to deal with quite considerably and set the high and low pass filters accordingly.
These tones are a series of flac files generated with ffmpeg.
108
Here is a a sample audio tone at a 2 kHz frequency.
109 (Insert Audio Sample Here)
110
Copies of the script to create the chirp signal and the tones are in the show notes.
--------------------
111 A "Not a Review" of some of the Hardware that I Used
I said that I would not do a review of the hardware that I used.
However, some of it deserves mention for either how good or bad it was.
I will record each section using the hardware being described.
112 Maxwell Headset
This is my original recording hardware.
This is a headset with boom mic and USB connection.
There is no model number on it, so I don't know the model.
This probably cost somewhere between 10 and 25 dollars.
The earpieces sit on the ears and do not fully enclose them.
This makes it light weight and comfortable to wear for extended periods of time.
It has a problem however with electronic noise consisting of a noise spike every 1 kHz.
I was able to fix this with a series of filters using FFMPEG.
Fixing this problem is what got me started in understanding audio.
I will probably continue to use this headset to make podcasts.
113 XTrike Headset, Model GH-510
This is also a headset with boom mic and USB connection.
I purchased this headset for the purposes of experimentation for this podcast episode.
It cost $12.88.
I found it to be surprisingly good for the price.
It has fully enclosed ear pieces however, which may make it uncomfortable to wear in hot weather.
I may try doing some of my future podcasting using this headset.
114 Borne Earpiece and In-line Microphone
This is a set of earplugs that go in your ears and connected by wires and a very small microphone built into a small bulge in the cable. It connects using a 3.5mm jack.
The model number seems to be BUD250-BL.
It cost approximately $3.00.
I bought several sets of these and use them for listening to podcasts from an MP3 player.
The ear pieces are pretty good for listening with.
The microphone works reasonably well when used in a quiet location.
It is less good when in a noisy environment.
It is very important however to secure the microphone to your lapel or other location reasonably near your mouth and to point the microphone (that is the small hole) outwards and not simply let it dangle freely.
If you let it just hang, you will get poor quality and inconsistent audio.
115 Yanmai Condenser Microphone, Model SF-910
I purchased this microphone for the purposes of experimentation for this podcast episode.
It cost $3.88.
As it is a condenser microphone, it is prone to picking up background noise more and as such is probably not a good choice for podcasting by single person sitting at a desk.
However, it is none the less a surprisingly good microphone for surprisingly little money.
116 iCan USB Microphone, Model M-306
I purchased this microphone for the purposes of experimentation for this podcast episode.
This has a USB connection.
This was also relatively inexpensive at $7.99, or roughly twice the price of the Yanmai microphone.
Unlike the Yanmai however, it is absolutely wretched.
There was such a high degree of distortion when recording through it that I found I could not use it in the fan experiments which I had bought it for.
I ended up buying the Yanmai microphone for that instead.
--------------------
117 Easy Effects Software
The techniques described so far all involve recording audio files and then processing them later to produce the desired result.
This is probably the simplest and most straightforward way of doing things if you are making a typical podcast.
However, there may be instances where you want to apply filtering or other effects on the "live" signal immediately and not after the fact.
118
There is audio software which can hook into your computer's audio system and do this with a live signal.
For Linux, there is a package called "Easy Effects".
This is Free Software and comes under a GPL V3 or later license.
I installed it from the Debian repository under Ubuntu 24.04.
119
You can create various filters and even chain them together to combine them.
I played with it a bit but do not know enough about it to discuss it seriously at this time.
However, I thought it would be worth mentioning for the sake of those who may wish to try it out themselves.
--------------------
120 Episode Conclusion
After having had some fun with audio and listening to other HPR members talk about audio, I thought I would have some more fun by playing with noise reduction filters.
I have no intention of becoming an audio professional, but by doing some experiments I learned a few things and had some fun doing it.
I hope that the rest of you found this interest as well.
I will see you all again later in another episode of Hacker Public Radio.
--------------------
Scripts
Basic Filter
This shows basic high and low pass filters ( 120 Hz and 8 kHz respectively)
and band reject filters for 50 and 60 Hz.
# The high and low pass filters.
hlpfil="highpass=f=120, highpass=f=120, lowpass=f=8000, lowpass=f=8000"
# Band reject filters filter for 60Hz and another for 50Hz.
linefil="bandreject=f=60:width_type=h:w=20, bandreject=f=50:width_type=h:w=20"
# Filter using ffmpeg.
ffmpeg -i inputfile.flac -af "$hlpfil, $linefil" outputname.flac
# ======================================================================
afftdn Filter
# noisefloor should be between 20 and 80.
noisefloor=$1
# Run the noise reduction.
ffmpeg -i testrec-filtered.flac -af "afftdn=nr=10:nf=-""$noisefloor" tmptestrec.flac
# ======================================================================
agate Filter
# threshold shoud be between 10 and 80.
threshold=$1
# Run the noise reduction.
ffmpeg -i testrec-filtered.flac -af "agate=threshold=-"$threshold"dB:range=-60dB" tmptestrec.flac
# ======================================================================
arnndn Filter
# mix should be between 0 and 1.
mix=$1
# Run the noise reduction.
ffmpeg -i testrec-filtered.flac -af 'arnndn=model=std.rnnn:mix='"$mix" tmptestrec.flac
# ======================================================================
sox noisered Filter
# Generate the noise profile from a sample of background noise.
sox silencefiltered.flac -n noiseprof noise.prof
# nramount shoudl be between 0 and 1
sox testrec-filtered.flac noiseout-testrec.flac noisered noise.prof "$nramount"
# ======================================================================
Manual Filter for Maxwell Headset Noise
# Create a series of band reject filters, from 1 kHz to 11 kHz.
ftemplate="bandreject=f=%s000:width_type=h:w=100"
kilospikefil=$( seq 1 11 | xargs printf "$ftemplate," )
# Using ffmpeg
ffmpeg -i testrec-filtered.flac -af "$kilospikefil" tmptestrec.flac
# ======================================================================
Create a "chirp" signal
# Start frequency.
f0=20
# End frequency.
f1=15000
# Duration of signal.
duration=10
ffmpeg -f lavfi -i "aevalsrc=sin(2 * PI * (0.5 * ($f1 - $f0)/$duration * t^2 + ($f0 * t))):s=44100:d=$duration" -c:a flac -af "aformat=sample_fmts=s16" chirp.flac
# ======================================================================
Generate Audio Tones
toneout () {
printf -v freqval "%05d" $1
ffmpeg -f lavfi -i "sine=frequency=$freqval:duration=3" tmptone.flac
# Normalize
ffmpeg -i tmptone.flac -af loudnorm=I=-17:TP=-2.0:LRA=4.0 -ar 44.1k -sample_fmt s16 tone$freqval.flac
rm tmptone.flac
}
# List of frequencies in hertz.
freqlist="50 60 100 120 130 140 150 160 170 200 500 1000 2000 3000 4000 5000 6000 7000 8000 9000"
for freq in $( echo $freqlist ); do
toneout $freq
done
# ======================================================================