Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#5 Now matlab scripts run correctly with modern matlab #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sedurCode
Copy link
Contributor

This PR updates the three matlab scripts to work with modern matlab.
The gitignore is also set up to ignore the common temporary files of matlab and python.
It is assumed that however you install ffmpeg by Brew, apt or downloaded binary, that ffmpeg will end up on the system path, therefore we are no longer 'locked' to opt/lib/usr...
Scripts should now perform the correct system calls on unix, mac and windows.

@google-cla
Copy link

google-cla bot commented Feb 11, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@sedurCode
Copy link
Contributor Author

@googlebot I signed it!

@ronw ronw added the cla: yes label Feb 24, 2021
sedurCode added a commit to sedurCode/carfac that referenced this pull request Mar 1, 2021
# This is the 1st commit message:

9 update cpp build settings and gtest compatability

# This is the commit message google#2:

Revert back to test suite when using a more uptodate version of gtest than supplied by apt-get

# This is the commit message google#3:

actually version 1.8

# This is the commit message google#4:

scons instructions update

# This is the commit message google#5:

google#5 Now matlab scripts run correctly with modern matlab

# This is the commit message google#6:

Update SConstruct to be python 3 compatible.
sedurCode added a commit to sedurCode/carfac that referenced this pull request Mar 1, 2021
# This is the 1st commit message:

9 update cpp build settings and gtest compatability

# This is the commit message google#2:

Revert back to test suite when using a more uptodate version of gtest than supplied by apt-get

# This is the commit message google#3:

actually version 1.8

# This is the commit message google#4:

scons instructions update

# This is the commit message google#5:

google#5 Now matlab scripts run correctly with modern matlab

# This is the commit message google#6:

Update SConstruct to be python 3 compatible.
# This is the commit message google#7:

revert matlab-related changes

# This is the commit message google#8:

whitespace
Copy link
Collaborator

@dicklyon dicklyon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates. I have a couple of suggested changes.

matlab/CARFAC_binaural.m Outdated Show resolved Hide resolved
matlab/CARFAC_SAI_hacking.m Outdated Show resolved Hide resolved
matlab/MakeMovieFromPngsAndWav.m Outdated Show resolved Hide resolved
@dicklyon
Copy link
Collaborator

dicklyon commented Mar 2, 2021 via email

@sedurCode
Copy link
Contributor Author

sedurCode commented Mar 2, 2021

% Rectify since nap can go slightly negative.

Change added.
If there are no more change requests let me know and I can shrink it down to one commit.

@dicklyon
Copy link
Collaborator

dicklyon commented Mar 2, 2021

All good by me. Thanks.

@sedurCode
Copy link
Contributor Author

Squashed to one commit.

@sedurCode
Copy link
Contributor Author

Hi @dicklyon I've just had a look at this stale PR from a couple years ago; Is this still valid, and are the changed still valid, or shall I close this PR?

@dicklyon
Copy link
Collaborator

dicklyon commented May 19, 2023 via email

Copy link

@yuhonglin yuhonglin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the work! The code here is indeed a bit outdated. Left a few comments.

Comment on lines +44 to +45
% Rectify since nap can go slightly negative.
image(63 * (max(0, smooth_nap)' .^ 0.5));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dick: should we rectify NAP like this or shift it?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just saw Dick's comment in another thread, so this should be OK.

Comment on lines +22 to +29
clear_old_files = true;

[status, msg, msgID] = mkdir('frames');

if (status && clear_old_files && strcmp(msgID, 'MATLAB:MKDIR:DirectoryExists'))
disp("Clearing old frames");
delete('frames/*');
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes the behavior of previous code: the previous code always deletes all the images but this one won't delete the images after the computation. Maybe let's move the deletion to the end of the computation?

%%
system('rm -r frames');

wav_fn, [wav_fn(1:end-4), '.mpg'])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use something like fileparts to bring back the CARFAC_SAI_movie_ prefix? https://www.mathworks.com/help/matlab/ref/fileparts.html

@dicklyon
Copy link
Collaborator

dicklyon commented May 23, 2023 via email

@sedurCode
Copy link
Contributor Author

Now that I have more time, I'll try to address your comments in a following commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants