These programmes are to demonstrate how to find the frequency structure, the multiplexing matrix (T) and the demosaicking matrix (D) for a CFA pattern given in a matrix. The frequency structure and the multiplexing matrix (T) can be used for CFA analysis and design. The demosaicking matrix is the inverse (or pseudo-inverse) of T, which can be used for CFA demosaicking with Dubois's methods: http://www.site.uottawa.ca/~edubois/CFA/ Copyright (c) 2007-2012, Pengwei Hao and Yan Li All rights reserved. For any commercial use of this program, a written permission can be obtained from the authors. please email: phao@eecs.qmul.ac.uk If this program is used for research, please cite in your publications: * Pengwei Hao, Yan Li, Zhouchen Lin, and Eric Dubois, "A Geometric Method for Optimal Design of Color Filter Arrays", IEEE Transactions on Image Processing, Vol.20, No.3, pp.709-722, March 2011. * Yan Li, Pengwei Hao, and Zhouchen Lin, "The Frequency Structure Matrix: A Representation of Color Filter Arrays", International Journal of Imaging Systems and Technology, Vol.21, No.1, pp.101-106, 2011. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.