If you have a PH account, you can customize your PH profile.

Matlab

Moderators: None (Apply to moderate this forum)
Number of threads: 599
Number of posts: 1020

This Forum Only
Post New Thread

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?



 
Popular resources and forums for programmers on Programmersheaven.com
Assembly, Basic, C, C#, C++, Delphi, Java, JavaScript, Pascal, Perl, PHP, Python, Ruby, Visual Basic
© Copyright 2009 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.
Publisher: Lars Hagelin. Read the latest words from the publisher here.
Be the first to sign up for Lars Hagelin’s In-depth Outsourcing Newsletter here.
bootstrapLabs Logo A BootstrapLabs project.