ÿþf u n c t i o n   O S S R G F _ d i a g o n a l ( M , l 1 , l 2 , H ) 
 
 % A u t h o r s   :   M .   C l a u s e l   a n d   B .   V e d e l ,   2 0 0 8 
 % c l a u s e l @ u n i v - p a r i s 1 2 . f r 
 % b e a t r i c e . v e d e l @ e n s - l y o n . f r 
 
 % M .   C l a u s e l :   L a b o r a t o i r e   d ' A n a l y s e   M a t h é m a t i q u e   e t   A p p l i q u é e   
 %   U M R   8 0 5 0   d u   C N R S   
 %   U n i v e r s i t é   P a r i s   E s t ,   
 %   6 1   A v e n u e   d u   G é n é r a l   d e   G a u l l e 
 % 9 4 1 0 0   C r é t e i l   C e d e x ,   F r a n c e 
 
 % B .   V e d e l :   L a b o r a t o i r e   d e   P h y s i q u e 
 % C N R S   U M R   5 6 7 2 
 % E N S   d e   L y o n 
 % 4 6 ,   a l l é e   d ' I t a l i e   
 % 6 9 0 0 7   L y o n 
 
 
 
 % T h i s   p r o g r a m   s i m u l a t e s   a   O S S R G F   X   s a t i s f y i n g   t h e   s c a l i n g   p r o p e r t y 
 %   X ( a ^ E   x ) =   a ^ H   X ( x ) 
 % f o r   t h e   d i a g o n a l   m a t r i x   E = [ l 1 , 0 ; 0 , l 2 ] 
 
 
 % I N P U T 
 % M = s c a l e   o f   t h e   c a r t e s i a n   g r i d   ( 2 ^ ( M + 1 )   x   2 ^ ( M + 1 )   p o i n t s ) 
 % l 1   a n d   l 2   :   e i g e n   v a l u e s   o f   t h e   d i a g o n a l   m a t r i x   ( c o e f f   o f   t h e   m a t r i x ) .   T h e y   h a v e   t o   b e   s t r i c t l y   p o s i t i v e 
 
 % H = H u r s t   c o e f f .   c h o s e n   b e t w e e n   0   a n d   m i n ( l 1 , l 2 )   ( s t r i c t l y ) 
 
 % O U T P U T :   
 % f i g u r e ( 1 ) 
 % 1 / p h i   w h e r e   p h i   i s   t h e   s p e c t r a l   d e n s i t y   a s s o c i a t e d   t o   t h e   c a n o n i c a l   p s e u d o - n o r m   
 
 % f i g u r e ( 2 ) 
 % s i m u l a t i o n   o f   t h e   F o u r i e r   t r a n s f o r m   o f   t h e   O S S R G F   o f   s p e c t r a l   d e n s i t y   p h i 
 
 % f i g u r e ( 3 ) 
 % s i m u l a t i o n   o f   t h e   O S S R G F 
 
 
 % C O O R D O N A T E S 
 
 
 X = ( - 2 * 2 ^ M : 2 : 2 * 2 ^ M ) / ( 2 ^ ( M + 1 ) ) ; 
 X ( 2 ^ M + 1 ) = 1 / 2 ^ M ; 
 Y = ( - 2 * 2 ^ M : 2 : 2 * 2 ^ M ) / ( 2 ^ ( M + 1 ) ) ; 
 Y ( 2 ^ M + 1 ) = 1 / 2 ^ M ; 
 X X = X ( o n e s ( 1 , 2 * 2 ^ M + 1 ) , : ) ; 
 Y Y = Y ( o n e s ( 1 , 2 * 2 ^ M + 1 ) , : ) ' ; 
 c l e a r   X   Y 
 
 
 % C O N S T R U C T I O N   O F   T H E   P S E U D O   N O R M   A N D   T H E   S P E C T R A L   D E N S I T Y 
 
 % r h o   i s   t h e   c l a s s i c a l   p s e u d o n o r m   a s s o c i a t e d   t o   t h e   d i a g o n a l   m a t r i x   w i t h   e i g e n v a l u e s     l 1   e t   l 2 :   
 % r h o ( x , y ) = ( a b s ( x ) ^ ( 2 / l 1 )   +   a b s ( y ) ^ ( 2 / l 2 )   ) ^ ( 1 / 2 ) 
 
 r h o = s q r t ( a b s ( X X ) . ^ ( 2 / l 1 ) + a b s ( Y Y ) . ^ ( 2 / l 2 ) ) ; 
 c l e a r   X X   Y Y 
 
 % p h i   i s   t h e   s p e c t r a l   d e n s i t y   o f   t h e   f i e l d   o b t a i n e d   v i a   r h o 
 
 p h i = r h o . ^ ( H + ( l 1 + l 2 ) / 2 ) ; 
 c l e a r   r h o 
 
 
 % C O N S T R U C T I O N   O F   T H E   F O U R I E R   T R A N S F O R M   O F   T H E   F I E L D   ( W I T H O U T   R E N O R M A L I Z A T I O N ) 
 % W =   F o u r i e r   t r a n s f o r m   o f   t h e   O S S R G F   
 Z = r a n d n ( 2 * 2 ^ M + 1 , 2 * 2 ^ M + 1 ) ; 
 W = f f t s h i f t ( f f t 2 ( Z ) ) . / p h i ; 
 c l e a r   Z 
 
 % f i g u r e ( 1 ) 
 % m e s h ( X , Y , p h i ) 
 
 % f i g u r e ( 2 ) 
 % m e s h ( X , Y , W ) 
 
 % C O N S T R U C T I O N   O F   T H E   F I E L D   ( F O U R I E R   I N V E R S E   +   R E N O R M A L I Z A T I O N ) 
 T = r e a l ( i f f t 2 ( i f f t s h i f t ( W ) ) ) ; 
 Z p = T - T ( 2 ^ M + 1 , 2 ^ M + 1 ) ; 
 m i n i = m i n ( m i n ( Z p ) ) ; 
 M a x i = m a x ( m a x ( Z p ) ) ; 
 
 
 f i g u r e ( 3 ) 
 i m a g e s c ( Z p , [ m i n i   M a x i ] ) ; 
 % c o l o r m a p ( g r a y ) ; 
 
