Reducing Noise from Matlab Generated Square Wave - SNR 0dB

Click For Summary

Discussion Overview

The discussion revolves around designing a filter to reduce noise from a Matlab-generated square wave with a signal-to-noise ratio (SNR) of 0 dB. Participants explore various filtering techniques and approaches to retain the integrity of the square wave while minimizing noise interference.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant suggests using a Chebyshev filter with ripples in the passband to match the spectra of the square wave, including its fundamental and harmonics.
  • Another participant proposes determining the cutoff frequency based on the frequency of the square wave and the sampling frequency, recommending a simple approach of placing the cutoff just above the fundamental frequency.
  • A more complex method is mentioned, involving matching the ripples of a Chebyshev or elliptical filter to the 1/f rolloff of the square wave's harmonics.
  • One participant introduces the idea of using a digital correlator design, explaining how it could provide better noise rejection if the frequency of the original signal is known.
  • The digital correlator approach involves using shift registers and coefficients to correlate the input signal with a bipolar square wave, aiming to reconstruct the original signal from the correlator output.

Areas of Agreement / Disagreement

Participants express multiple competing views on the best filtering approach, with no consensus reached on a single method. Different techniques, such as Chebyshev filters and digital correlators, are proposed, each with its own merits and considerations.

Contextual Notes

The discussion includes assumptions about the knowledge of the original square wave's frequency and the effectiveness of various filtering techniques, which may depend on specific conditions not fully explored in the thread.

guru
Messages
38
Reaction score
0
I posted the details of myquestions earlier but no help. Maybe I need to rephrase it.
I basically generated a square wave and added noise to it using Matlab.
The question is how do I design a filter to reduce as much noise as possible to retain most of the square wave. The SNR is OdB.

Thanks in advance
 
Physics news on Phys.org
Sounds like a Cheby filter with ripples in the passband (or an elliptical with ripples everywhere) would work the best, with the ripples matching the spectra of the square wave (fundamental, 3rd harmonic, etc.).
 
berkeman said:
Sounds like a Cheby filter with ripples in the passband (or an elliptical with ripples everywhere) would work the best, with the ripples matching the spectra of the square wave (fundamental, 3rd harmonic, etc.).

thanks for the help!:smile:
How do I determine the cutoff (corner) frequency to use given the frequency of the square wave and the sampling frequency.
 
guru said:
thanks for the help!:smile:
How do I determine the cutoff (corner) frequency to use given the frequency of the square wave and the sampling frequency.
If you want to keep it simple, just use the fundamental of the square wave, and put the cutoff right above that. A little fancier is what I was mentioning, to match a Cheby/elliptical filter's ripples to the 1/f rollof of the square wave's harmonics. The best solution, though, would be to do a correlation with a square wave of the same frequency. Do you always know the frequency of the original square wave?
 
berkeman said:
If you want to keep it simple, just use the fundamental of the square wave, and put the cutoff right above that. A little fancier is what I was mentioning, to match a Cheby/elliptical filter's ripples to the 1/f rollof of the square wave's harmonics. The best solution, though, would be to do a correlation with a square wave of the same frequency. Do you always know the frequency of the original square wave?
Edit -- I think a straight digital correlator design would give you the best results, if you know what the frequency of the original signal is. A digital correlator is where you have a shift register that you feed your input digitized signal into one end, and at each sample clock tick, you shift the data through the ganged registers. For each sample clock tick, you multiply each register value by some coefficient, and take the overall sum of the multiplications as the correlator output for that clock tick. To correlate against a bipolar square wave, for example, the coefficients for the first half of the ganged registers would be something like +1, and for the second half they would all be -1. The correlator is one period long for the square wave, measured in sample clock ticks.

So when you feed in your bipolar square wave plus noise, the output of the correlator will be +A (A=amplitude of the input signal) when the input signal lines up with the square wave coefficients, and -A when it lines up opposite of the coefficients. The correlator output is not a square wave -- instead it has peaks where the correlation is max and min, and zero crossings between these peaks. To convert the correlator output back to a square wave, use the A number and the zero crossings to take your best guess at the original signal. You will get very good noise rejection by using a correlator, especially if you have lots of samples per cycle, and as many bits per sample as possible. You should be able to get well below a 0dB SNR with a good correlator design. You can do this all in MatLab, so try it out! -Mike-
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
10K
Replies
17
Views
6K
  • · Replies 1 ·
Replies
1
Views
11K
  • · Replies 3 ·
Replies
3
Views
3K
Replies
3
Views
8K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 6 ·
Replies
6
Views
9K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 4 ·
Replies
4
Views
5K