Matlab

Moderators: None (Apply to moderate this forum)
Number of threads: 1080
Number of posts: 1761

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
SVD inconsistency Posted by adikash on 17 Nov 2009 at 7:54 PM
Cannot figure out why the Matrix S1 and S2 differ. Seems to work when the Matrix S1 is a random matrix (rand) but when the source is a wave file which has been made into a matrix using the Short time Fourier transform S! and S2 differ and i cannot seems to get back the original matrix S1. Anybody has any clue Why this happens?

y = wavread('source.wav');
S1= myspectrogram(y); % Generic routine to get the STFT
[U S V]=svd(S1);
S2= U*S*(V');

If anybody has any clue plz reply. Thanks for looking.
Report
Re: SVD inconsistency Posted by jjasso5 on 20 Nov 2009 at 7:53 PM
It should work. I can't see the problem...

From time to time there are some bugs appearing in Matlab...
Try to clear your workspace and try again.
Or exit from Matlab, re-enter and retry your function.

Do this to test it

clear; clc; format compact

A = [1 2 3
4 5 6
7 8 9
1 2 3
8 6 2]

[u s v] = svd(A);
m = u*s*v'

Does m equal A?



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.