Finding Realistic Data for Bandpass Filter Program Testing

In summary, Warren wants to generate wave data to test a bandpass filter, but does not know how to generate wave data. He found a way to generate wave data using a continuous function, and also found some MATLAB data sets that he could use.
  • #1
Pythagorean
Gold Member
4,401
313
I want to work on a bandpass filter program, but I'd like some realistic data to try it on. There's got to be something on the web to write/test programs with.

Any suggestions?
 
Physics news on Phys.org
  • #2
to be more specific, it's wave data I'm looking to transform, not image data.

Infrasound data is most relevent, but any amplitude vs. time data will do.

It doesn't even really have to be mock as long as it's downloadable and in txt or m format.
 
  • #3
Why don't you just create your own test signals?

- Warren
 
  • #4
chroot said:
Why don't you just create your own test signals?

- Warren

How would I generate data? I imageine using rand and sin functions, but I want to make sure that it's actually transformable, so any mistakes are in the code and not in the data I generated.
 
  • #5
It's just a bandpass filter, right? So any continuous (or sampled) data of any kind would be fine. I don't know what you mean by "transformable."

- Warren
 
  • #6
chroot said:
It's just a bandpass filter, right? So any continuous (or sampled) data of any kind would be fine. I don't know what you mean by "transformable."

- Warren

By transformable, I mean transformed from amplitude (pressure) vs. time, into amplitude vs. frequency, where you cut out the frequencies you don't want, then transformed back into amplitude vs. time.

I guess I should know that any continuous function can be transformed like that, I just want to make sure it's somewhat relevant to what I do at work (which is analyzing infrasound signals)

edit: I'll try throwing the rand function into a sin function unless you have a better idea that's relevant.
 
  • #7
Just compose a signal that's a sum of some number of sinusoids, some of which should be attenuated by your filter.

Or, use some of MATLAB's built-in data sets like chirp or handel.

- Warren
 
  • #8
Wow, didn't know about those. Thanks for your help, Warren!
 
  • #9
Haaaaallelujah! :biggrin:

- Warren
 
  • #10
I feel kind of stupid after giving this a little more thought, it's as easy as:

Amp = sin(w1*t) + sin(w2*t) + sin(w3*t) + cos(w4*t) + cos(w5*t)

where t is your equally spaced time array and the Wn are simply constants.

whew, that grain of sand was tough to climb...

I have the student version of Matlab at home, don't know if chirp or handel come with it, but I can't seem to find them. I like making my own data better though!

Thanks once again!

edit: HA! I found the chirp/handel and played them, now I see where the Hallelujah! came from..
This rocks, I could totally write music in matlab...
 
Last edited:

1. How do I find realistic data for bandpass filter program testing?

There are a few different ways to find realistic data for bandpass filter program testing. One option is to use a signal generator to create a test signal with the desired frequency and amplitude. Another option is to use real-world data, such as audio recordings or sensor readings, that have been previously filtered by a bandpass filter. You can also use simulation software to generate test data based on a mathematical model of your filter.

2. What types of signals should I use for bandpass filter program testing?

The signals you use for bandpass filter program testing should have frequencies within the passband of your filter. This will help ensure that the filter is accurately passing the desired frequencies and attenuating others. You can use sine waves, square waves, or other periodic signals for testing. It's also a good idea to use signals with varying amplitudes to test the filter's response to different signal strengths.

3. Can I use random noise for bandpass filter program testing?

Random noise can be useful for testing the performance of a bandpass filter, but it should be used carefully. The noise should have a flat frequency spectrum, meaning it contains all frequencies in equal amounts. This will allow you to see how the filter affects different frequencies. However, since noise is not a periodic signal, it may not provide a comprehensive test of the filter's behavior.

4. How can I validate the results of my bandpass filter program testing?

One way to validate your results is to compare them to the expected output based on the filter's specifications and the input signal. You can also use simulation software to compare the results of your program to a known filter response. Additionally, you can test your program on a known signal that has been filtered by a physical bandpass filter to see if the results match.

5. Are there any common mistakes to avoid when testing a bandpass filter program?

One common mistake is not thoroughly testing the filter's response to different input frequencies and amplitudes. It's important to test a variety of signals to ensure the filter is functioning as expected. Another mistake is not taking into account the potential effects of noise and other external factors on the filter's performance. It's also important to carefully analyze the results and compare them to expected outputs to identify any errors in the program.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
16
Views
2K
  • Electrical Engineering
Replies
2
Views
1K
  • General Engineering
Replies
0
Views
693
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • Programming and Computer Science
Replies
1
Views
925
  • Engineering and Comp Sci Homework Help
Replies
2
Views
846
  • Electrical Engineering
Replies
10
Views
2K
  • Materials and Chemical Engineering
Replies
12
Views
529
Back
Top