On Digital Watermarks in the Frequency Domain

Matlab Examples of Image and Audio Digital Watermarks in the Frequency Domain, Rolf Brigola

Watermarking Example in the DCT Domain of an Image

Download the m-Files here, save them to your Matlab working directory and run them there.
Embed Image Watermark   example watermark
Detect Image Watermark
Generate Noise and Compression of the Image Data
Watermark Test Image
Test Image

Original (201 KB)

Noisy image with watermark
with digital watermark in the frequency domain
JPEG compressed and noisy (74 KB)

Computed watermark in the compressed and noisy image

computed watermark from noisy image

Let’s have a look at the DCT spectrum in a logarithmic scale and observe that the most energy is in the
left upper corner corresponding to lower frequencies:

 

 

Watermarking Example in the FFT Domain of an Audio File

The following m-files do by no means contain any professional watermarking algorithms. They are merely an exercise
for first or second year students to see that information can be embedded into the fft domain of an audio file.
To play with these m-files you need a stereo audio track in wav-format of approximately 90 seconds duration.
Save all the files below to your Matlab working directory and run them from there.
I embedded the watermark at frequency 5 Hz in the audio fft, which is not in the range of usual loudspeakers or headphones.

Embed Audio Watermark:   Example audio watermark
Detect Audio Watermark
Detect Audio Watermark after MP3 Compression
Test Image as Watermark
Comparison of Spectral Sections of the Original and the Watermarked File
Plot the Noise Spectrum caused by Watermarking

Test the sound files with headphones, which usually provide a much better transmission than speakers.

If you do not have a suitable wav file at hand, you can take the following for a test (15 MB)

Renate Bergmann (Voice) and Klaus Jäckle (Guitar)

If you do not have Matlab, you can listen and see the results here:
Watermarked example file from above
The detected watermark is:   detected audio watermark in the example

As you see, there are many bit errors in the result and this “watermark embedding” would not survive a mp3-compression
of the marked audio file. You can test this with the above m-files. You can easily find many embedding algorithms and
literature on the subject by asking a search machine for digital watermarks.