I wanted to ask does it matter in Image Processing in which order I apply the filter. If I apply Median Filter first and then some Low Pass Filter, will it be different if I applied Low Pass Filter first and then Median Filter?
How can we explain this conceptually?
Yes, the results will be different. This is because a median filter is not an LTI system, and thus the operations cannot be arbitrarily reordered.
Related
I found a lot of references on how to calculate biquad filter coefficients for first and second order low/high pass filters but none for higher orders.
I'd like to implement Nth order Butterworth filters for my speaker crossover program though. Can anybody please point me to the formulas I need?
here I go answering my own question:
I broke down the code of scipy.signal.butter() and implemented it in C for the case of N=3 (third order). The result can be found at https://gitlab.com/t-5/ladspa-t5-plugins/blob/master/src/coeffs.h (see the functions butter_3rd() and the two helpers poly() and convolve() ).
I've implemented a fuzzy search algorithm based on a N closest neighbors query for given search terms. Each query returns a pre-set number of raw results, in my case a max. of 200 hits / query, sorted descending by score, highest score first.
The raw search already produces good results, but in some rather rare cases not good enough so I've added another post-processing layer or better said another metric to the raw search results based on Levenshtein-Damerau algorithm that measures the word / phrase distance between query term(s) and raw results. The lower the resulting score the better, 0.0 would be an exact match.
Using the Levenshtein-Damerau post-processing algorithm I sort the results ascending, from the lowest to the highest.
The quality of matches is amazingly good and all relevant hits are ranked to the top. Still I have the bulk of 200 hits from the core search and I am looking for a smart way to limit the final result set down to a maximum of 10-20 hits. I could just add a static limit as it is basically done. But I wonder if there is a better way to do this based on the individual metrics I get with each search result set.
I have the following result metrics:
The result score of the fuzzy core search search, a value of type float/double. The higher the better
The Levenshtein-Damerau post processing weight, another value of type float/double. The lower the better
And finally each result set knows its minimum and maximum score limits. Using the Levenshtein-Damerau post processing algorithm on the raw results I take the min/max values from there.
The only ideas I have is to take a sub-range out of the result set, something like the top 20% results which is simple to achieve. More interesting would be to analyse the top result scores/metrics and find some indication where it gets too fuzzy. I could use the metrics I gather inside my Levenshtein-Damerau algorithm layer, respectively the word- and phrase-distance parameters - these values along with 2 other parameters make up the final distance score. For example if the word- and/or phrase distance exceed a certain threshold, then skip the result. This way is a bit more complicated but possible.
Well, I wonder if there are more opportunities I could use and just not obviously see. Once again, I would like to omit a static limit and make it more flexible on each individual result set.
Any hints or further ideas are greatly appreciated.
One quick question regarding Bloom Filter,
If I allocate the size of Bloom filter exactly same as that of number of elements going to be inserted and also using unique hash functions, can I ensure that it won't result in false positive case.
Note that in my case, I know the number of elements going to be inserted well in advance before bloom filter creation
thanks
Prabu
Yes you can. You can create some hash function that does 1:1 mapping. But in that case, there is no point of using Bloom Filter. The whole point of Bloom filter is to save space.
Since they fill up and the percentage of false positives increase, what are some of the techniques used to keep them from saturating? It seems like you cannot empty out bits, since that would make an immediate negative on data stored in that node.
Even if you have a set of known size, in a data store using bloom filters like Cassandra what confuses me is that the data in a node is going to be added and removed, right? But when you remove a key you cannot set its bloom filter buckets to 0 since that might create a false negative for data in the node that hash to one or more same buckets as the removed key. So over time, it is as if the filter fills up
I think you need to set an upper bound on the size of the set that the bloom filter covers. If the set exceeds that size, you need to recalculate the bloom filter.
As used in cassandra, the size of the set covered by the bloom filter is known before creating the filter, so this is not an issue.
Another aproach is Scalable Bloom Filters
The first thing you should realize is that bloom filters are only additive. There are some approaches to approximate deletion:
Rewriting the bloom filter
You have to keep the old data
You pay a performance price
A negative bloom filter
Much cheaper than the above, also helps deal with false positives if you can detect them.
Counting bloom filters (decrement the count)
Buckets
Keep multiple categorized bloom filters, discarding a category when it is no longer needed (e.g. 'Tuesday', 'Wednesday', 'Thursday',...)
Others?
If you have time-limited data, it may be efficient to use buckets, and discard filters that are too old.
I'm using a FIR filter to oversample audio. It's a simple typical windowed sinc, i.e. a sinc function truncated and windowed. As usual it requires past and 'future' samples to work. in practical terms this means the audio output is delayed.
The sinc function is an ideal low pass filter. My question what is the equivalent, except with no 'future' samples required. I guess this function is the same as the impulse response of a brick wall IIR filter. It will have a perfect brick-wall cuttoff, but will not have perfect phase response.
If you want a particular frequency response, then a minimum phase filter would provide the lowest "delay" or latency of IIR or FIR filter with that response. An IIR filter with all its poles and zeros inside the unit circle would be a minimum phase filter. A minimum phase filter is also not linear phase, so you'll have to release that constraint to reduce latency. A FIR filter can be approximately converted to minimum phase either by cepstum techniques (see Oppenheim & Schafer), or by numerically solving for an IIR filter with a similar enough frequency response, flipping all the poles and zeros inside, and converting a suitably windowed impulse response back to a FIR filter.
Trying to get any less than minimum phase delay will flatten a filter's transition band(s) until, at "zero" delay, the filter would either have to reject nothing or reject everything, and thus become useless.